I was wondering how to do two things in Blueprint Scripting:
How do I make an actor, like Spikes in a wall, deal damage
AND
How do I make another actor, like a player, receive that damage?
I have only found answers for making an actor receive damage, but not to assign an actor to give damage. Please help me understand this!!! Thank you!!!
Any damage will receive all types of damage (unreal offers a few out of the box) and Apply damage will trigger that event on the other actor.
Now to fire this event you simply need some kind of hitbox and once it does collide or overlap with something, take the resulting “Other Actor” and pull a line from that pin to your “Apply Damage” node.
Any Damage will then receive an input and you can handle your HP in the actor which just got hit.
So Apply damage in your bullet or inside of your spikes blueprint. Any Damage in your Character or whatever should get hit.
First please check with a “Print String” if “Event Any Damage” is receiving any input at all.
And secondly look in your spike settings if it does fire “Overlap” events. There is a setting for each part where you can set if it should or should not do so meaning it can potentially just not fire at all. (While you’re at it check this for your character as well. Better safe than sorry
This is basically the correct way to do it though. However you might want to subtract the HP before checking because right now it is possible (if the character gets more than 1 damage) that he has negative HP… which is not really ideal to say the least ;D
If there is still nothing then you did not make a mistake with the damage system but with how you set up your actor.
You somewhere have not checked the “Overlap” checkbox for your component or it is set to “Block” as collision (this may be called, dynamic actor or whatever but after all it would block whatever causing it to not overlap).
My wild guess would be you did not setup a hitbox (or at least not properly).
It looks like you only have the spike mesh. If this one is set to collide with everything (since it is a part of your level. Nothing should pass through) it can not possibly overlap with anything since everything is just colliding with it and bouncing off.
Try a “Event Hit” and check with a “Print String” node if there is a signal.
Or go directly one step ahead and set up a “Box” in your components. Place it where the player should be damaged (at least slightly above your mesh) and set it to “Overlap All”.
I got event hit to trigger when the character touches it. I’m not sure what to do next though. I’m really sorry for all the questions. I wish I could find an expert around where I live and have them show me this stuff
You mustn’t destroy the controller but only the pawn (basically your player character).
Set your camera to something else (like a topdown view of the scene or something) and then after you spawned a new player / actor possess this one again.
If you have trouble with this you might want to create a new question though.
And remember to chose the answer as correct again since it deselects it every time a comment is added to it… and people should know this is solved for you