How do I change frames with a mouse click

Get help using Construct 2

Post » Fri May 26, 2017 9:18 am

Hi!

I want to click an object, which has three frames, each of them different, I use the events displayed in the image.
Ive also tried adding instance variables to the mix and also tried skipping the sub-events and making two different events, with no luck.
All results are the same, when i click it the first time, it goes to the last "2" frame, instead of stopping at the first.
My goal is to click the object, make it go to frame "1", then when i click it again go to frame "2", not go directly to two.

What am i missing, this seems very simple, but gives me headaches :(

Things ive tried
http://i.imgur.com/amgmJc8.jpg
http://i.imgur.com/5rYpJGl.jpg
B
12
S
2
G
2
Posts: 20
Reputation: 1,942

Post » Fri May 26, 2017 9:52 am

set stone frame to (stone.AnimationFrame+1)%stone.AnimationFrameCount

or if you just have two frames

set stone frame to 1-stone.AnimationFrame
Image Image Image
B
43
S
22
G
15
Posts: 379
Reputation: 12,254

Post » Fri May 26, 2017 10:23 am

I'm very sorry but I only use the Event Editor, not any scripts :/ so that confuses me, will look into it and see if i can figure it out anyway.

Edit: I got it to work! Thanks, now lets see if i need more help with giving functions them :D
B
12
S
2
G
2
Posts: 20
Reputation: 1,942


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, JackTYGA, worm1, Yahoo [Bot] and 23 guests