I'm pretty new to Unity so please bear with me.
What I want to do:
I want my simple game object to have a linear speed on Z axis (white path on the screenshot) and perform a simple animation while this object is moving
So I have attached rigidbody to my green game object and attach a script to it and get the required component and set velocity to 10f.
myRigidBody = GetComponent<Rigidbody> ();
myRigidBody.velocity = new Vector3 (0,0,10f);
This works and the object starts moving when I hit "play" in Unity editor.
The problem:
If "Animator" component on this game object is checked, the player won't move (but it will perform animation). When I uncheck this component the game object will start to move.
In the animation itself, I'm changing the position of game object (Y axis - jump), and rotation (will flip).
The question:
Why my game object won't move (even that I've given it a linear velocity), when the animator component is checked (in action)?
I want this game object to be moving and on click perform an animation.
This is basically it. Any help highly appreciated.
EDIT: Animation values:
X
andZ
values in the animation. You should change only theY
value. – Mateusz