Unity Issue Tracker - Animator Component gives incorrect Layer count when using animator.layerCount
Closed
UUM-14294
Animator Component gives incorrect Layer count when using animator.layerCount
Unity: Mecanim Animation
Won't Fix
2023.3.X
2023.2.X
2023.1.X
2022.3.X
2022.2.X
2022.1.X
2021.3.X
2020.3.X
2022.1 has reached end of life so the issue will be fixed in a newer version.
How to reproduce:
1. Open the attached project “IN_14247”
2. Open “SampleScene” in Scenes
3. Select the "Game Object" GameObject
4. In the Inspector right click on “Layer Count Logger” Script and press “PrintLayerCount"
5. Observe the results in the Console
6. In the Project folder open “New Animator Controller” Animator Controller
7. Add additional Layer
8. Select the "Game Object" GameObject
9. In the Inspector right click on “Layer Count Logger” Script and press “PrintLayerCount"
10. Observe the result in the Console
Expected result: “2” is printed in the Console
Actual result: “0” is printed in the Console