Mirou123 Posted December 4, 2013 Share Posted December 4, 2013 Hello I'm new in LUA I tryed to create this small script I want it to change the camera's look at position function SetCameraLookAt() local screenx, screeny, worldx, worldy, worldz = getCursorPosition() local cx,cy,cz,clx,xly,clz = GetCameraMatrix(playerid) SetCameraMatrix(cx ,cy ,cz ,worldx, worldy, worldz) end end addEventHandler( "onClientCursorMove", getRootElement( ),SetCameraLookAt) I can't see what's wrong with this code I hope you can help oh by the way in the code before this one I set the camera's position to a location using SetCameraMatrix and I used showCursor.One last thing,this is a client side script Link to comment
csiguusz Posted December 4, 2013 Share Posted December 4, 2013 It would be more helpful if you didn't just say "it's not working" but say what is it doing instead (e.g what's the error message if there is one). By the way, there is no function called "SetCameraMatrix", use setCameraMatrix. And playerid is not defined, use getLocalPlayer. Edit: oh, and "GetCameraMatrix" is also wrong. Link to comment
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