Creating random animations using code only.

Updated on December 4, 2016 in [A] Animation
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
3 on December 4, 2016

If I’m making a 2D game and I want my enemy to perform multiple random animations(transitions/actions) at random intervals, is it possible to be done using only code and not the Animation editor?

For example:
1- Enemy moves from point A to a random point at a random interval.
2- Then, he rotates to a random angle at a random interval.
3- Then he scales to a random point at a random interval
4- Repeat all the steps forever.

  • Liked by
Reply
2 on December 4, 2016

You could use an RNG counter like in SM64

on December 4, 2016
You could use an RNG counter like in SM64From LordGeezmo

 I don’t understand any of this, could you explain more? 

Helpful
on December 4, 2016

Randomly generate a number between 0 and say… 1000 each frame or second, store it in an int and start the animation if the number is above or below a certain number.

Show more replies
  • Liked by
Reply
Cancel