playMaker

Author Topic: Random float range & random float range on change  (Read 3256 times)

derkoi

  • Full Member
  • ***
  • Posts: 187
Random float range & random float range on change
« on: August 24, 2013, 04:37:03 AM »
Hey,

Here's another 2 actions I made out of necessity whilst programming AI.

I wanted to take a float variable and give it a random fluctuation based on a minimum & maximum range from the input.

eg: if my input value is 10 & my minimum was 5 and my maximum was 5, i would get a random value between 5 and 15. If my input was 100 i'd get a random value between 95 and 105.

The 2nd action is the same as above but only happens when the input value changes.

Have fun.  ;)

the_jinxster

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Random float range & random float range on change
« Reply #1 on: February 25, 2015, 08:56:50 AM »
Thanks for this!