Right now, I am making a Sonic game. In Sonic games, when Sonic gets hit by a spike trap, he’ll lose rings. Hit again, he’ll lose a life. I want it to be just like the Sonic games. Keep in mind that I am using Blueprints. I just made the spike trap using meshes, and I am doing the functions.
Hey!
I strongly recommend you to use the already built-in “damage system”.
Each actor can receive damage (if CanBeDamaged is true) with the Apply Damage function.
When an actor received any damage, the event AnyDamage of that actor will be called.
What that means for you:
In the spike trap, apply damage to the overlapped actor.
In your player character, override the AnyDamage event and implement your damage logic.
For instance you first subtract the rings by one, if no rings are left, subtract the damage from the players health.
Once no health is left, implement some death mechanic.