MoveTowards action stops when stopping animation?

I have dragged several pngs into the scene. Creating an animation sequence.

I have added a cs file to the sequence which uses MoveTowards inside the update. However I want to only start the png sequence after x seconds have passed.

When I disable the animation the movetowards does not run. As if the animation.enabled = false statement kills the movement of the object within the scene.

Do you know how to swich off the Animator in the menu from the c# code? So that I can control start Animator?

Thanks.

Upvotes: 0

Views: 33

Answers (1)

Uri Popov
Uri Popov

Reputation: 2167

On a script that is on the same game object as the Animator do this :

GetComponent<Animator>().enabled = false;

Upvotes: 1

Related Questions