- Home /
What movment does the character do
Hi, i am trying to do an animation system based on the movement of an object and its facing direction. But this is where i am stuck, how do i figure out if the object is moving to its side , forward or backward?
Answer by nventimiglia · Jul 07, 2012 at 04:16 PM
I invoke my animation when I execute the movement (from the controller).
You could alternatively compare the transform's position from the position last frame.
Hmmm, i dont have any key pressed or any thing like that for my target. Its just gonna be a NPC that do things depending on the world around him/her. But it might work to just before when the movement code is, just to play the animation until the movement code say stop...
Well the Npc 'controller/brain' script then.
void OnUpdate(){ if(shouldWalk){ npcWalker.Walk(); npcAnimator.Walk(); } }
Your answer
Follow this Question
Related Questions
How to Rotate the Player In Direction of Movement? 4 Answers
Original Blender character faces ground when not walking 2 Answers
How can I get my character to face the direction he is moving? 1 Answer
Help with my Character Controller 1 Answer
Making a character move automatically in one direction. 2 Answers