playMaker

Author Topic: Random float -x/+x [SOLVED]  (Read 2113 times)

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Random float -x/+x [SOLVED]
« on: July 20, 2014, 06:57:59 PM »
Hi,

Is there any way of generating both the positive and negative version of a random float?

I tried doing the simple math (get the random float value, multiply by 2 and subtract the original by the multiplication) but there doesn't appear to be a way to store the results.
« Last Edit: July 21, 2014, 06:16:43 AM by MajorIdea »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Random float -x/+x
« Reply #1 on: July 20, 2014, 07:34:52 PM »
Multiply the random float by -1 (using a float operator action)

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: Random float -x/+x
« Reply #2 on: July 21, 2014, 06:16:24 AM »
Good ol' Float Operator. How did I forget about it! :D  Thanks!