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?
My first project:
Image
B
20
S
8
G
1
Posts: 172
Reputation: 2,463

Post » Sat Jan 28, 2017 2:37 pm

random(0,1) will only ever pick 0.
B
46
S
16
G
76
Posts: 2,150
Reputation: 45,313

Post » Sat Jan 28, 2017 3:12 pm

But my frames are 0 and 1. How do I pick between those two frames?
My first project:
Image
B
20
S
8
G
1
Posts: 172
Reputation: 2,463

Post » Sat Jan 28, 2017 3:38 pm

int(random(0,2))
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

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
33
S
9
G
7
Posts: 450
Reputation: 6,780

Post » Sat Jan 28, 2017 6:15 pm

Okay, the problem was something else, and I've fixed that. Thx
My first project:
Image
B
20
S
8
G
1
Posts: 172
Reputation: 2,463


Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, kellehk and 25 guests