- Home /
An empty idle animation overwrites values set through the FixedUpdate code
Hello.
I am relatively new to the Unity environment. I am creating a 2D game. My character's avatar consists of only one single sprite. Due to its specific crawling-like type of movement, I apply some scale changes on the entire object representing my character (lets say it's something like a spring-wiener dog toy if you've ever seen one ;) ).
Now, I wanted to add an animator to the character's object, but unfortunately I've encountered a problem. I would like to apply to the object some animations on specific occasions, but I don't really need an idle animation. In other words, I want that the animator has no effect on the object in its idle state. At first, I created the state "Idle" in the animator controller and assigned no animation to it. It doesn't work. For some reason, the animator overwrites my character's sprite (opacity in this case), along with its scale. That is, the values assigned through the code are being overwritten by the default character's sprite. Eventually, that breaks up the whole crawling-through-scaling idea and for me it really feels crucial for this character.
My second idea was to create an idle state animation, but without adding any parameters to it. The effect is the same as leaving the animation slot unassigned.
I would really love to get some help here, since right now I have completely no idea how to resolve this issue. Thanks in advance :)
Your answer
Follow this Question
Related Questions
Why do my animations only play once? 1 Answer
How to get reference to a specific Animation Clip in Animator. 0 Answers
What are the best practices for reusing an animation controller? 0 Answers
How to Loop a Animator Controller Component using wrapMode PingPong 1 Answer
Trigger Animation Via Script 2 Answers