By Narkoz Posted September 21, 2022 Share Posted September 21, 2022 How can I rotate the camera viewed ped left and right with the mouse? Link to comment
Przemcio Posted September 21, 2022 Share Posted September 21, 2022 onClientClick (clickedWorld) + onClientCursorMove. Link to comment
By Narkoz Posted September 21, 2022 Author Share Posted September 21, 2022 I did it with the functions you said but the ped is spinning so fast how can I slow it down tiklandiX = 0 a = 180 addEventHandler("onClientCursorMove", getRootElement(), function(_, _, x, y) if peds then if pedCheck == true then yeniX = x - tiklandiX px,py,pz = getElementRotation (peds) if a > 360 then a = 0 elseif a < 0 then a = 0 end if yeniX >= 0 then a = a + 1 setElementRotation(peds,0,0,pz + (x/2)) outputChatBox(x) else a = a - 1 setElementRotation(peds,0,0,pz + (x/2)) outputChatBox(x) end end end end) function addLabelOnClick(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if (clickedElement) then pedCheck = true tiklandiX = absoluteX else pedCheck = false end end addEventHandler("onClientClick", root, addLabelOnClick) Link to comment
By Narkoz Posted September 28, 2022 Author Share Posted September 28, 2022 Is anyone interested. Link to comment
Snow-Man Posted September 28, 2022 Share Posted September 28, 2022 (edited) You have to reduce number of z rotation setElementRotation(peds,0,0,pz + (x/100)) Edited September 28, 2022 by Snow-Man 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