FWCentral Posted December 13, 2011 Posted December 13, 2011 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)
Castillo Posted December 13, 2011 Posted December 13, 2011 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.
FWCentral Posted December 13, 2011 Author Posted December 13, 2011 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 ) Thanks solidsnake! Edit: Its still doing the error i mentioned above
ThaD4N13L Posted December 13, 2011 Posted December 13, 2011 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 ) 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)
FWCentral Posted December 13, 2011 Author Posted December 13, 2011 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)
FWCentral Posted December 13, 2011 Author Posted December 13, 2011 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
Castillo Posted December 13, 2011 Posted December 13, 2011 Ehm, if you reconnect, the camera will move of course .
12p Posted December 13, 2011 Posted December 13, 2011 (facepalm) He tries to mean that the camera isn't always posed in the same position when the script is called.
FWCentral Posted December 13, 2011 Author Posted December 13, 2011 Yeah its after the player has chosen a vehicle from the shop that is opened by a marker, so i want it to be in the same position every time.
Castillo Posted December 13, 2011 Posted December 13, 2011 Oh, you mean when you set the camera back to the player?
12p Posted December 13, 2011 Posted December 13, 2011 (double facepalm) No, when camera matrix is used.
FWCentral Posted December 13, 2011 Author Posted December 13, 2011 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 EDIT And now its not
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now