Jump to content

Ped walks in wrong directions


SuperBrandy

Recommended Posts

Hi there!

I hope someone can help me, i got a little problem with the ped rotation.

local x,y,z = getElementPosition(getLocalPlayer()) 
local rotx, roty, rotz = getElementRotation(getLocalPlayer()) 
  
setElementPosition(Ped, x + 1 , y, z) 
setElementRotation(Ped, rotx, roty, rotz) 

The Problem is that the ped rotates z-axis exact the other way then i am. For example while i got a z-rotation of 0 the Ped also got 0. But while i am having a rotation of 30 degrees the ped has a rotation of 330 degrees. I don't know why.

I also tried to let the ped walk with

setPedAnimation( Ped, "ped", "WALK_player") 

and

setPedControlState(Ped, "forwards", true) 

The Problem there is, that the ped walks more backwards if the rotation gets nearer to 180 degree. At 180 and 270 degree the ped walks straight bachwards while the animation seems to go forwards so in the opposite direction.

Thanks for help!

Link to comment

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