How do I apply damage when specific components of two actors touch?
Okay, so in my game I have a ship pawn that's made of several components.
In the center is the actual ship itself, then there's a flat plane with a texture applied that creates a sort of glowing shield around the ship.
I have it scripted so that if any enemy overlaps the shield, it applies a certain amount of damage per second.
I want to have it so that if the enemy ship overlaps my actual ship (not the shield) that it applies damage to the player ship.
I've tried OnHit events, but they seem to work sporadically, and only if the player ship is moving around.
I've tried overlap events, but I can't get it to apply damage only when overlapping specific components.
TLDR: How do I apply damage when specific components of two actors touch?
asked Mar 07 '16 at 05:05 PM in Blueprint Scripting
The solution is "On Component Begin Overlap".
With that function you can determine a component of your actor AND get the "Other Component" so you can check if it is a shield / ship or something else.
So basically check "on component begin overlap (ship)" IF "Other Component" EQUALS "Shield" -> Deal Damage.
answered Mar 07 '16 at 06:47 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here