Jump to content

setCameraTarget problem


FWCentral

Recommended Posts

Posted

im trying to create a vehicle shop, I need to make the camera aim at a vehicle.

Client:

  
local veh = createVehicle(560, -1655.89819, 1211.46692, 20.5659,0,0,60) 
setCameraTarget(veh) 
  

This doesn't do anything?

(It does create the vehicle and there are no errors)

3677124c9d4d768da64a55d5bebf578e.png
Posted

Read the wiki note:

This function allows you to set a player's camera to follow other elements instead. Currently supported element type is:

Players

Use setCameraMatrix instead.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

ok i used setCameraMatrix and it changes positions on its own, One time its in one place the next when i restart its moved without me editing it. (NVM working now :P) Thanks solidsnake!

Edit: Its still doing the error i mentioned above :(

3677124c9d4d768da64a55d5bebf578e.png
Posted
ok i used setCameraMatrix and it changes positions on its own, One time its in one place the next when i restart its moved without me editing it. (NVM working now :P) Thanks solidsnake!

Edit: Its still doing the error i mentioned above :(

if your making a loginGUI then do something like this

function onJoin() 
    outputChatBox("YOur Things") 
end 
addEventHandler("onPlayerJoin", getRootElement(), onJoin) 
addEvent("playerJoinResourceStart", false) 
addEventHandler("playerJoinResourceStart", getRootElement(), onJoin) 

Posted

Im trying to make a vehicle shop, the setCameraMatrix worked but it still moves when i reconnect or restart it.

  
veh = createVehicle(560, -1655.89819, 1211.46692, 20.5659,0,0,60) 
setCameraMatrix(-1658.09436, 1219.95898, 22.1562) 
  

3677124c9d4d768da64a55d5bebf578e.png
Posted

What do you mean by "moves"?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

It just moves, I put it at the right location then restart the script and it looks fine, Then without editing the script again when i reconnect or restart then it moves to a different place right near the place it should be

3677124c9d4d768da64a55d5bebf578e.png
Posted

Ehm, if you reconnect, the camera will move of course o.O.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Oh, you mean when you set the camera back to the player?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Nah that works fine, its:

veh = createVehicle(560, -1655.89819, 1211.46692, 20.5659,0,0,60)

setCameraMatrix(-1658.09436, 1219.95898, 22.1562)

That makes it go to the right place, Works fine - When i reconnect to the server this will be the exact same script but it will be in a different direction.

EDIT

Seems to be working fine now, Didn't change anything :P

EDIT

And now its not :P

3677124c9d4d768da64a55d5bebf578e.png

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...