Announcement

Collapse
No announcement yet.

Set Spectator Camera Location/Get Location/etc?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • carparso
    replied
    Ah!
    That really helps. Ty.

    Leave a comment:


  • Talos
    replied
    Did you guys see this library for cameras? https://github.com/dig/onset-camera-library

    Leave a comment:


  • carparso
    replied
    Maybe I do the same mistake...Can anyone explain to me, why the camera will stand "in" the body of the player, after call "SetPlayerSpectate" ? I expected that the Camera will move (client.lua)


    server.lua
    Code:
        function specCamera(player)
            SetPlayerSpectate(player, true)
    
            CallRemoteEvent(player, "SpecToTrader")
    
        end
    client.lua
    Code:
    AddRemoteEvent("SpecToTrader", function()
    
    
            SetCameraLocation(163047.359375,37.959445953369,24 80.48046875,true)
            SetCameraRotation(338.54016113281,37.959445953369, 0.0)  
    
    
    
              ShowMouseCursor(true)
              ShowChat(true)
    
    
              ShowWeaponHUD(false)
              ShowHealthHUD(false)
    
    
               SetIgnoreMoveInput(true)
               SetIgnoreLookInput(true)
    end)

    Leave a comment:


  • Pindrought
    replied
    Originally posted by Tommy View Post
    You use to GetCameraLocation(true) get the spectate camera and you use SetCamerLocation() to "attach"
    Yeah, it looks like we're only able to get the spectator cam location atm :/. I ended up writing an alternative camera for now.

    SetCameraLocation does nothing in spectate mode for me.

    Leave a comment:


  • Tommy
    replied
    You use to GetCameraLocation(true) get the spectate camera and you use SetCamerLocation() to "attach"

    Leave a comment:


  • Tommy
    replied
    Originally posted by Pindrought View Post

    Thanks, but sadly that does nothing
    Is it placed on the client-side?

    Leave a comment:


  • Pindrought
    replied
    Originally posted by Tommy View Post
    Try this:

    Code:
    SetCameraLocation(x, y, z, true)
    Thanks, but sadly that does nothing

    Leave a comment:


  • Tommy
    replied
    Try this:

    Code:
    SetCameraLocation(x, y, z, true)
    Last edited by Tommy; 01-14-2020, 02:11 PM.

    Leave a comment:


  • Pindrought
    started a topic Set Spectator Camera Location/Get Location/etc?

    Set Spectator Camera Location/Get Location/etc?

    Is it possible to get/set the spectator camera location, heading, toggle noclip, etc?
    Last edited by Pindrought; 01-13-2020, 06:49 AM.
Working...
X