Problem with collisions

Get help using Construct 2

Post » Wed May 11, 2016 3:40 am

Hello people,
I have a condition that says "if bullet collides with the enemy family then spawn a hit effect and destroy it"(destroy the hit effect). The problem is that if I hit 2 enemies at the same time it spawns multiple hit effects and it doesnt destroy them, so if I keep on hitting 2 at the same time it creates so many the game starts to freez
B
8
S
1
Posts: 10
Reputation: 412

Post » Wed May 11, 2016 9:33 am

Add a timer to hit effect and start it when the effect is created. Then, add a condition when timer ends destroy the object(effect).
B
4
Posts: 3
Reputation: 202

Post » Wed May 11, 2016 1:50 pm

use maybe the "for each" too..
B
11
S
1
Posts: 28
Reputation: 1,963

Post » Wed May 11, 2016 5:16 pm

You are not just spawning and destroying your Hit Effect in the same tick, right ?
In that case, you have some delaying code and indeed using the condition "For Each Hit Effect" can help out.

Otherwise consider posting the capx for your issue so we can see how you implemented things so far.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Wed May 11, 2016 7:34 pm

Thank you for your replays, I just fixed the problem adding a condition "when hit effect animation finishes destroy hit effect"
B
8
S
1
Posts: 10
Reputation: 412


Return to How do I....?

Who is online

Users browsing this forum: AndreasR, Yahoo [Bot] and 7 guests