- Home /
How to move character with specific units with animation?
I'm having trouble making the character walk with specific units including animation. I used transform.translate() and anim.SetFloat() but it's not animating . I'm using Ethan character. Which code should I use? Thanks!
@Cherno Example if i click a button, the character will move 9f to the z axis with walking animation. If I use trasform.traslate(), it has no anima and it's like teleporting. Can you help me? :) Sorry for my english.
You can do two things. If the motion is always the same, then just create an animation clip and set the keyframes accordingly (by changing the transform.position).
If the characters should move more flexibly, then use Vector3.Lerp along with the transform.position and target position. The Scripting API has examples on how to use it.
I'm just a newbie. Hehehe. Can I create animation clip with ethan?
Answer by SunnyChow · Aug 12, 2016 at 02:53 AM
Try DoTween. It's a good tweeter library. Or you can use Update() or Enumerator to move it frame by frame.
@SunnyChow I tried DOTween but there is no option for using Ethan's animation. I just need to move the character just like 1 step using only a button gui (Forward).