Norhy Posted March 14, 2015 Share Posted March 14, 2015 hey guys i have this fp script player = getLocalPlayer() function findRot(x1, y1, x2, y2) local t = -math.deg(math.atan2(x2 - x1, y2 - y1)) return t < 0 and t + 360 or t end addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getPedBonePosition(player, 6) setCameraMatrix(x, y, z) end ) addEventHandler("onClientCursorMove", getRootElement(), function(_, _, _, _, wX, wY, wZ) local x, y, z = getPedBonePosition(player, 6) setPedRotation(player, findRot(x, y, wX, wY)) end ) the problem is, when i move the mouse my rotation is reset . how do i fix it? Link to comment
JR10 Posted March 15, 2015 Share Posted March 15, 2015 You already use onClientRender to change the camera matrix, you don't need to detect anything else. Remove the onClientCursorMove part. 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