Forum rules - please read before posting.

3D NPC moving along the path with wrong rotation

I have a duck moving on a pre-path. In order to look "horizontal", the rotation vector of the assets must be (-90,0,0). When the action list starts executing, the rotation vector is changed by (0,x,0), where x is the direction of the vector between the two points of the path the duck is.

I tried to add an "Object: Transform" node in the action list but it did not work. Locking x angle in Rigidbody did not work either. I am not using any animator controller.

Any help is highly appreciated.

Thanks in advance!

Comments

  • Characters rotate to face the direction they're moving in. To keep your model at a fixed angle, move their graphic components to a child object and then attach a script that keeps it locked:

    using UnityEngine;
    
    public class LockAngles : MonoBehaviour
    {
    
        public Vector3 fixedAngles = new Vector3 (-90f, 0f, 0f);
    
        void LateUpdate ()
        {
            transform.eulerAngles = fixedAngles;
        }
    
    }
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.