RandomInRange() not working (SOLVED)

Greetings,

In my test project, I want my player to spray water (Like the squirt fishes from Yoshi’s Island do).

I want to add a slight amount of randomness to the squirt angle, so I typed the code as so:


(Note: Instant forces don’t work here, only permanent ones)

For some reason, I’m getting no randomization at all, and after trying different things, I can’t fathom why.

If it helps, to give the water some gravity, I have another force being applied to the object that goes down:

Am I doing something wrong? Help is appreciated, thankuuuu

I think you need to reverse your random range numbers. The 1st number needs to be less than the second and since the numbers are negative, -43 is greater than -47. Try -47,- 43

1 Like

Keith is on point here
I also had problem understanding it but
RandomInRange(Min , Max)

So if you look at this
image

So -4 is lower than 1 where 1 is higher
So it would be RandomInRange(-4,1) NOT RandomInRange(1,-4)

1 Like