How do I toggle animation frame with click

Get help using Construct 2

Post » Sun Feb 07, 2016 6:09 pm

I'm trying to toggle a sprites animation frame by clicking it. I wasn't able to find any examples of how to do this except for this old closed bug"

Image

I can't recreate this using my recent version of C2. I can't nest the sprite under the mouse event, neither can I create a System Else event without a prior System event.

Can this even be done now or are there alternative ways please?

TIA
B
8
Posts: 27
Reputation: 365

Post » Sun Feb 07, 2016 6:17 pm

Try removing the else, as it messes up what object is picked. Other than that I can't see anything wrong with the event
Banned User
B
6
S
3
Posts: 105
Reputation: 1,170

Post » Sun Feb 07, 2016 6:26 pm

Right-click on the green arrow - this left most area selects the event, as opposed to the condition. Now Add->sub-event. The Else is fine, you don't need to test frame=1, though, it's redundant.
ImageImageImage
B
71
S
19
G
180
Posts: 3,481
Reputation: 103,183

Post » Sun Feb 07, 2016 6:45 pm

Thanks for following up. I tried right clicking the green arrow and adding a sub-event but the actions offered by the sprite now do not include setting the frame #.
B
8
Posts: 27
Reputation: 365

Post » Sun Feb 07, 2016 7:13 pm

The condition is "Compare frame". To set the frame you "Add action", and then "Set frame".
ImageImageImage
B
71
S
19
G
180
Posts: 3,481
Reputation: 103,183


Return to How do I....?

Who is online

Users browsing this forum: RetroSpock, Shadedds, skrotar and 10 guests