Identical events work differently

Get help using Construct 2

Post » Sat Jan 28, 2017 2:33 pm

Message: RobertMKD can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
I am trying to create more objects of one type and change the current animation frame for each instance to a random one. The problem is, it works for one object, while it's not working for another object, even though the events are identical.

http://prntscr.com/e1fuyh this one works well.

http://prntscr.com/e1fv6t while this one makes the animation frames of all instances of this object the same.

What may cause this?
B
18
S
6
Posts: 137
Reputation: 1,641

Post » Sat Jan 28, 2017 2:37 pm

random(0,1) will only ever pick 0.
B
45
S
15
G
73
Posts: 2,002
Reputation: 43,386

Post » Sat Jan 28, 2017 3:12 pm

But my frames are 0 and 1. How do I pick between those two frames?
B
18
S
6
Posts: 137
Reputation: 1,641

Post » Sat Jan 28, 2017 3:38 pm

int(random(0,2))
ImageImageImage
B
71
S
21
G
220
Posts: 3,648
Reputation: 123,725

Post » Sat Jan 28, 2017 4:26 pm

RobertMKD wrote:But my frames are 0 and 1. How do I pick between those two frames?


choose(0,1)
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
32
S
9
G
7
Posts: 444
Reputation: 6,731

Post » Sat Jan 28, 2017 6:15 pm

Okay, the problem was something else, and I've fixed that. Thx
B
18
S
6
Posts: 137
Reputation: 1,641


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests