For Each

Get help using Construct 2

Post » Thu Aug 01, 2013 4:03 am

Okay I'm completely stumped. I thought I understood how For Each works, but apparently I don't.

Can anyone explain why this isn't working?



When I have 2 ghosts on the screen, they both do the proper animations and attack, but one of them shoots 4-5 projectiles (for each tick the frame still = 4) and the other shoots 1 like it should.

Healp!
B
27
S
5
Posts: 472
Reputation: 2,502

Post » Thu Aug 01, 2013 5:17 pm

If you will share your capx it will be more easier to help you :P
B
39
S
16
G
6
Posts: 238
Reputation: 7,875

Post » Thu Aug 01, 2013 6:01 pm

I think you dont need the last For Each
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Thu Aug 01, 2013 6:29 pm

I actually figured it out. Apparently it was the placement of the "trigger onces" and "for each". For the 2nd to last event, I moved the "trigger once" with the "animation = attack & frame = 4" and the 'for each" where the current trigger one is.

However, what I don't understand is why that fixed it...
B
27
S
5
Posts: 472
Reputation: 2,502

Post » Thu Aug 01, 2013 6:40 pm

"Trigger once" limits the action to one instance. Not sure why. Real pain to work around sometimes.
Image
B
234
S
27
G
13
Posts: 1,784
Reputation: 18,274

Post » Thu Aug 01, 2013 6:41 pm

Interesting - that's good to know. Thanks, guys!
B
27
S
5
Posts: 472
Reputation: 2,502


Return to How do I....?

Who is online

Users browsing this forum: kabaal, oddreal, raulcg1981 and 9 guests