I made a weapon that’s basically a sticky grenade launcher. If it hits a Character, then the grenade attaches itself to the Character.
I got it working, except for one detail: if the character dies, any attached grenade keeps floating in the air. How can I solve this problem?
I thought about adding an “event listener” on the attached character, which would trigger an event on the projectile blueprint if the character dies. I just can’t figure out how to do that. But other ideas are welcome as well.
Note: the Character, Weapon, and Projectile are all class blueprints, so changes could be implemented on either of them.
Details: The attachment itself is made on the Weapon, because it’s an instant hit (trace) weapon. A projectile (AShooterProjectile) blueprint is spawned on the hit location, and if the trace returned a Character as its HitActor, then an attachment is made on the newly spawned grenade.