Random(8) Not working...

Get help using Construct 2

Post » Thu Jul 19, 2012 7:38 pm

Hey I'm trying to create a Random Fly Pattern.




It is Not working.

However If I change the Random(8) to a Number. Then it works.. But is ofc not random...
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Thu Jul 19, 2012 7:51 pm

What about round(random(1-8))?

Think something's a little off that. Should I use round or float? Hmm...

Also, do you need the "elses"?AnD4D2012-07-19 19:52:01
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Post » Thu Jul 19, 2012 7:57 pm

Sadly not working.. I probably dont need the elses :) But not working with or without
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Thu Jul 19, 2012 8:03 pm

Manual:
random(x)
Generate a random float from 0 to x, not including x. E.g. random(4) can generate 0, 2.5, 3.29293, but not 4. Use floor(random(4)) to generate just the whole numbers 0, 1, 2, 3.

Try: floor(random(8))
ImageImageImage
B
67
S
19
G
122
Posts: 3,207
Reputation: 73,401


Return to How do I....?

Who is online

Users browsing this forum: luckyrawatlucky, mindragon73 and 26 guests