Issue with Incorrect Enemy Instance Getting Affected by Collision Events

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Video: webmshare.com/play/RLNZ6

    Event: i.vgy.me/Qc3lsf.png

    At 00:06 seconds in the video, the enemy at the bottom is touching the mine, but instead, the enemy at the top is getting destroyed.

    Similarly, at 00:12 seconds, the enemy at the bottom is touching the shield, but the enemy at the top is the one that gets blasted.

    This issue happens randomly, sometimes one object collides, but a different object is affected.

    I used a separate collision object (the green bar at the bottom) to trigger the mine and shield events. I also used the "Pick instance with" event to ensure the correct enemy is affected.

    How can I make this more precise and bug-free?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • When you create the green sprite it is not related to a particular enemy. You can add the green sprite to a 'Container' with an enemy, that means it is created with the enemy at the start (you don't need to create it) and also it is always related with the enemy in picking conditions.

    Then for the actual event if you say green sprite on collision with mine -> destroy green sprite. It would also destroy the enemy with it as they are in a Container. Note : your current condition pick with UID doesn't do anything.

  • When you create the green sprite it is not related to a particular enemy. You can add the green sprite to a 'Container' with an enemy, that means it is created with the enemy at the start (you don't need to create it) and also it is always related with the enemy in picking conditions.

    Then for the actual event if you say green sprite on collision with mine -> destroy green sprite. It would also destroy the enemy with it as they are in a Container. Note : your current condition pick with UID doesn't do anything.

    Great!, works perfectly after using container, Thank you very much...

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)