[Solved] How do I damage a single enemy upon bullet collision?

Seems simple enough, but when a bullet is in collision with one enemy, all enemies in the scene take damage. Conditions tested include:

  • bullet in collision with enemy
  • enemy ID stored in bullet Array, then if first index of the array matches enemy ID
  • bullet / enemy linked
  • boolean variable “beingHit” toggled


This seems a lot more conditions and events than necessary. This should do the job:

1 Like

Are you sure the health is changing for all of the objects or could it just be showing the same value. Are you using 1 text object or 2?

1 Like

Thanks for responding. You are correct, this works correctly. My issue was in the displaying of the health points.

I appreciate your observation, and you were correct in that the same health value was being displayed for all instances. After updating the health display, the enemies accurately show their health points and are damaged/killed properly. Thanks!

DebuggingSolved.PNG

1 Like