- Home /
How do I attach a script to a state
I am extremely confused.
A week ago I finished a platformer project. I was working in Unity 5 2D. I had a stick figure with a player controller and an animator controller attached. The player controller measured the player's horizontal acceleration (in FixedUpdate) and checked whether he was airborne or not to determine the animator state he was in. Different states had different animations, which were simple repeating rotations I have scripts for.
Problem is I have made a new project and copied what I have done. However, I cannot get the new stick figure to animate. Importing assets from the old project doesn't seem to work and, besides, I want to add new states in my animator controller.
When I go back to my original project I cannot seem to find anything that says (WHEN PLAYER IS IN STATE X, PLAY SCRIPT A) but it must be there somewhere. When I check the animation scripts I can find no reference to the animator controller and vice versa.
What is happening?
Answer by Dorthonion · Nov 29, 2017 at 11:00 AM
EDIT: realised it has something to do with 'Animation view'
Your answer
Follow this Question
Related Questions
Animator and Scripting problems. Help !! 1 Answer
Climbing a block in 2d 0 Answers
why I have to anim.getComponent in update() function when I had done in Start () function 2 Answers
How to make a companion that trails character moves, and not collide? 0 Answers
Lots of errors using speed multiplier in animation (2D). 0 Answers