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,433

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
79
S
12
G
7
Posts: 961
Reputation: 10,717

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,433

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
71
S
21
G
212
Posts: 3,617
Reputation: 119,663


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 7 guests