#look in movement direction
1 messages · Page 1 of 1 (latest)
yeah i did that too, still messes up
what messes up?
yep
or a child?
Nope, on the scripted object
i see the problem is the movement relies on your facing direction to move
can you try replace your move function with this - might not be the same controls you want for your game though, hard to tell
{
Vector3 MoveVector = PlayerMovementImput * Speed;
PlayerBody.velocity = new Vector3(MoveVector.x, PlayerBody.velocity.y, MoveVector.z);
transform.LookAt(transform.position + PlayerBody.velocity);
Vector3 nRot = transform.eulerAngles;
nRot.x = 0;
nRot.z = 0;
transform.rotation = Quaternion.Euler(nRot);
if (Input.GetKeyDown(KeyCode.Space))
{
PlayerBody.AddForce(Vector3.up * Jumpforce, ForceMode.Impulse);
}
}```