Position, Animator & RigidBody
I'm a bit of a noob and I'm trying to understand the motion relationship between the Animator and Transform of a GameObject.
I created a GameObject parent that holds an NPC (The NPC has a head, body, legs, and arms). At first, I used transform.position
to move the GameObject and it worked fine. Then I made some walking animation and added an Animator and RigidBody2D to the parent GameObejct. After adding it the object stopped moving but the animation was working. I didn't really understand why but after reading a bit found that the now that I have an Animator it's controlling the motion or something...
So I did a couple of things. I changed the script to move the rigid body and not the transform and then added 'use root motion' in the animator. and the NPC started moving again.
Then I noticed that if I turn off root motion but select 'Animate physics' int the update mode, motion works too.
So what I'm asking is what is really going on here. When you add an animation to an object do you HAVE to use root motion or am I doing something wrong? And should I move the rigidbody or the transform? Any clarification would be greatly appreciated.