Greetings (Sorry for posting so much ),
In my game, I have a lava droplet hazard. Each droplet spawns with a hurtbox connected that hurts the player. You might be wondering why though. You know how in Smash Bros, when a character attacks, these red hurtboxes appear to indicate what can hurt the opponent? Thatâs kind of what Iâm trying to replicate in GDevelop for more precise collision detection.
Anyways, my lava droplet has the âDestroy Outside of Screenâ behavior for optimization (And in case any lava falls off screen). However, I then realized that while the lava droplet gets destroyed, itâs connected hurtbox does not. Upon testing, once I get out of range of the lava droplets and then return, the hurtboxes are simply floating there.
I really donât want the player to take any unfair âPhantom damageâ from a floating hurtbox they canât see, so I tried to make it so that when the lava droplet is far enough offscreen, the hurtbox would be destroyed too.
This is what I did so far, but it doesnât seem to work (Bottommost code):
Is it possible to make an object with the Destroy Offscreen behavior destroy any linked objects as well? Also, I fell like some might suggest to add the Destroy Offscreen behavior to the hurtbox too, but itâs going to be reused for everything that damages the player throughout the game, and for what I have planned, it could cause problems for me in the future (E.G. A stationary enemy with a hurtbox always active, but if you go offscreen, his hurtbox disappears).
Thanks ^^