- Home /
Randomly Play Animator Animation
I am working on platform based game so various obstacles contain movement and I created animation for this purpose.
I have created moving animation of obstacle from left to right and right to left side and it was working properly. It get started from 0 unit and completed at 10 units and traveling back to 0 unity place always.
In this I want to add variation, its starting point will be dynamic so one time it get spawned on 5 unit and complete rest journey of pre recorded animation, next time it spawn at 3 unit and complete rest journey up to 10 units. and then travel back.
So that game player can't predict the behaviour of obstacles otherwise its easy to predict obstacle movement. I hope you are getting me into this so provide me some suggestion.
What i'm getting is that you have an animation and want to use it from a dynamic point to 10u and back. Right?
yes you are right - at present its moving animation, next time may be another obstacle with rotation animation - I want to play them on desire point not just 0 to 1 pre-recorded playback.
Try the random to choose everything and from script control the animator into making the transitions right with variables?
Your answer
![](https://koobas.hobune.stream/wayback/20220612173333im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make an animator controller efficient 1 Answer
How to deal with the Transitions If I have ten or more kinds of Animations in Unity Animator? 0 Answers
How can I change my AnimatorState instantly? 1 Answer
Animation Running Game 0 Answers
How to get reference to a specific Animation Clip in Animator. 0 Answers