- Home /
How to choose between two animation options in the Animator?
I have an animated scene that plays, and I have given the user two options to click on. When they click on either of these options, I want the relevant option's animation to play. After that, I want the relevant option to take the user to another scene. I know how to change scenes using an event trigger and a change scene script, but I have no idea how to use the state machine to give either or options. I've tried using a trigger parameter, but this just triggers both animations. I've tried using bools, but don't know how to use it properly and they don't seem to work in the way I want; when the VR object onPress_vr should be true and when the AR object is clicked, onPress_ar should be true. I have created a trigger animation script and attached it to each of the objects along with an event trigger and bool enabled. Please see the screenshots below and let me know if you need any more information. Many thanks in advance. I'm sure I'm missing something simple, but all the tutorials I've searched for only offer idle animations to one other animation, not lots of different options, and I'm surprised I haven't found out more about this. I'm not asking the right questions, I guess. Thanks again.
Answer by sasskiaduncan · Feb 18, 2018 at 11:24 AM
And a picture of my code:
Your answer
Follow this Question
Related Questions
Animator slow transitions and animations playing twice. How to set up transitions correctly? 0 Answers
Dynamically accessing value for multiple usage in AnimatorController transition conditions. 1 Answer
Root motion accuracy issue 0 Answers
Is there any way to make the default animation transition instant? 2 Answers
Animator transitions bug?,Animator transition bug? 3 Answers