Debug Unity Animation Controllers Easily!
Today I want to show a really helpful bit of code to help you showcase or debug your animations. Credit to Jason Weimann for the code.
Disclaimer: I did not come up with this, and recently found it thanks to Jason Weimann’s recent video. I found it very useful, and wanted to share it with you.
After creating a new “AnimationShowcase” script, we only need 2 methods (or even 1 if you want it all in Start):
Create a Canvas with a child Panel, with a Layout component attached (vertical/horizontal/etc), and a default button. Save the button as a prefab in your project files.
After adding the AnimationShowcase component to the Panel object, set the Animator and Button references:
If it’s all set up correctly, you can press Play and see any Animator Trigger parameters turned into functional buttons.
I know I found this useful, and I hope you do to!
If you haven’t already, check out his channel for some great Unity game development content.