- Home /
Unity2D Animation issues
So I have a flying enemy and to make it more lively I want it to be animated going up and down. I got the animation working but the enemy no longer follows the player. I made sure to remove the x,z properties from the animation but the controller no longer moves the character it's adding velocity and everything.
Answer by _Yash_ · Jul 07, 2016 at 04:17 AM
if its continuous motion you should write a script that moves the enemy instead of animation because animation will override the physics.
void LateUpdate(){ transform.position = initialPos + new Vector3(0f,Mathf.Sin(Time.time),0f); }
Your answer
Follow this Question
Related Questions
How I make my enemy face the player or flip towards player (top-down game)? 0 Answers
2D Animation does not start 1 Answer
2D 8-directional enemy AI sprite animation with Blend Tree not using correct animations 0 Answers
Animation streches the model all wrong 0 Answers
Damn, HOW CAN I KNOW, IF MY 2d ANIMATION SPRITE IS FINISHED??!! 0 Answers