Setting up a basic 2d side scroller with some sprites such as cactus and other various items. When the player touches the cactus they are suppose to lose HP, but the OnComponentHit is making my char lose HP as long as I have the D key held down, it’s like he is constantly trying to run into the cactus.
What would be a better way to do this? Have the cactus knock him back? If so, how would I achieve that effect?
Also, if I jump on top of the cactus the player will take the normal .25 damage but when I start walking off the cactus he takes no additional damage. It’s only when I run into the side of the cactus that his HP will continue to drop as long as I’m pressing the D key.
It’s just been a good while since I’ve played any 2d side scrolling games so not sure if this is a normal mechanic in those games or if there would be a better approach to it.
Also, another quick question on that subject, would it be best to check the players health inside the Actor BP to tell if he should die or should I have a Event Tick inside the Character BP to check his health every tick to determine if he dies?
Trying to figure out the best way to set this up with minimal mess inside all the BPs.