Jump to content

setCameraMode


rjcnz333

Recommended Posts

I need to fix the camera. I have made everything as in an example, but the camera isn't fixed

setCameraMode(playerid, "fixed") 
    setTimer (setCameraPosition, 1000, 1, playerid, 1984.4445, 160.9501, 55.9384) 
    setTimer (setCameraLookAt, 1000, 1, playerid, 1984.4445, 157.9501, 55.9384) 

Link to comment

I've been having a problem getting the camera to work too and all the posts on the subjects aren't getting answered or resolved from what I can tell. Is there something wrong with the Camera function? Does it have to be done at a certain time? I've copied exact code from the wiki and posts from other posters and I still can't get the Camera to work right. Here's the code I have on it

  
function setCamPosition() 
    toggleCameraFixedMode(true) 
    setCameraPosition(-16.268127441406, -46.674671173096, 29.565118789673) 
    setCameraLookAt(-68.21085357666, 34.687622070313, 11.11138343811) 
end 
  
addEventHandler("onClientResourceStart", getRootElement(),setCamPosition) 
  

EDIT: If your screen is staying black you need fade in first.

Link to comment
  • 2 weeks later...

I got round this by setting the camera mode to 'player' first, and then to 'fixed'. Also to fix some other occasional problems I setTimers on most of the calls to stagger them and give them time to execute - it seems to have solved most of my issues.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...