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
47
S
18
G
84
Posts: 2,261
Reputation: 49,776

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
257
Posts: 3,788
Reputation: 142,692

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)
Find all the Construct 2 games that were on Steam Greenlight here
B
36
S
10
G
7
Posts: 475
Reputation: 7,015

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: humanescape, R0J0hound, warmty and 5 guests