How do I create random frame.

Get help using Construct 2

Post » Mon Jan 02, 2017 4:32 pm

Hello guys,

I have an issue when i try to create a sprite with random frame.

so first i create the object and then i use sprite set animation frame to random(1)

I tried with random(0) also with random(0,1) and i cant create sprites with random frame.

Anyone can please help me?

Thanks and regards.
B
32
S
13
G
6
Posts: 363
Reputation: 5,101

Post » Mon Jan 02, 2017 4:36 pm

int(random(2)) will give you 0 or 1.
ImageImageImage
B
71
S
22
G
258
Posts: 3,791
Reputation: 143,198

Post » Mon Jan 02, 2017 5:31 pm

int(random(animationframecount+1)) as blackhonet said, or use round or floor (random(0,animationframecount)) will cut the .3231321 digits after the full number
B
78
S
23
G
69
Posts: 1,354
Reputation: 44,027

Post » Mon Jan 02, 2017 5:39 pm

OMG dude, you are my hero, thanks a lot.
B
32
S
13
G
6
Posts: 363
Reputation: 5,101


Return to How do I....?

Who is online

Users browsing this forum: RIDETHEPIG, Yahoo [Bot] and 8 guests