Menu button toggle play mesh animation
HI all,
I am looking to have a toggle button that play an animation on a mesh. I made the animation and created a toggle parameter in Animator. I created a toggle button UI. But now I am desperately trying to link that button Ui and the toggle parameter in Animator. I created a On value Changed in the button Inspector. But I don't know how to link it. Can it be done without a script? Just with the value changed menu drop-down? I expected to be the case, because I am an idiot regarding scripting. I looked at a lot of questions asked in forums, but I did not find a solution that works for me. I would greatly appreciate any help. Thank you in advance,
Thomas
Answer by Tharmine02 · Apr 16, 2016 at 08:50 PM
Thank you for the quick answer.
Your example use a trigger but I created a bool in Animator.
It is working fine when I test it there.
Should I just replace in the script trigger by toggle? Or bool?
Here is my animator window :
@Thar$$anonymous$$e02
Yes, but you will need to make sure that you set each state in the animator to act on the boll value appropriately and you will need to attach a script that sets animator.SetBool() when toggled.
Thank you,
but unfortunately I have no idea how to do that.
I tried to manipulate the code in the link you send with no success.
Your answer
Follow this Question
Related Questions
Button OnClick Event won't set Animator Trigger 0 Answers
Animator boolean problem 2 Answers
Timescale Pause Combined with Animated UI 1 Answer
How do I get my UI controls to work in different scenes? 0 Answers
Toggle UI Text With UI Toggle Button 1 Answer