#Can someone help me to make my player react to damage in a general point
5 messages · Page 1 of 1 (latest)
Can you post your code? Or a link to it?
The first two are the script form the enemies and the other two, is the player reacting to them
A good way to generalize this is to make a Hitbox script and a Hurtbox script that both extend Area2D. When a hurtbox collides with a hitbox, the hitbox emits a custom signal received_damage() so other scripts can do things when they listen to it
Then you give each enemy a Hurtbox and your player a Hitbox