B
B
BadCats2018-03-30 23:46:11
Unity
BadCats, 2018-03-30 23:46:11

Variable interaction with different animation layers?

There are two layers of animation
5abe9e25d0212577391046.jpeg
- the base layer is responsible for the "planet" disappearing - the second one is for launching the display of asteroids (space theme of the scene)
Base layer
5abe9ec8c607b039193997.jpeg
The second layer
5abe9f16a5194421501910.jpeg
in both layers - the transition condition from NewState - to another state - this is a boolean variable P - must be
true I change the value of the variable - it works on pressing the button

public void Load()
    {
        var animator = planet.GetComponent<Animator>();
        animator.SetBool("p", true);
    }

The most interesting thing is that in the inspector - changing the variable is not displayed - but the effect on one of the animations - the one that disappears the planet - works, and the second animation - on the second layer - does not work. And only when I manually in the inspector - set the value to true - the second animation is triggered - the one on the secondary layer.
That is, it is strange that the value is apparently still set to true - once the first animation is triggered, but why the change is not displayed in the inspector and the second animation does not work is not clear.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question