Only Overlap with a specific component of Third Person Character?

Is it possible to set up an Overlap event with only a specific component of the Third Person Character?

I’m trying to create a collision event between an enemy and the player character but only when two specific collision boxes overlap. Right now, its always the player characters capsule component.

Yeah, you can do that like this:

Thanks! I’ve got the enemy character component casting to my third person character.

But, I’m trying to find a way to be more specific about what part of the third person character, I don’t know how to go about setting that up.

what exactly do you mean? The specific part comes from the on component overlap. You choose the component there

drag off the blue dot and type “get (whatever component you are interested in)

Sorry for any confusion. I’m fairly new to this and I’m not sure if what I’m asking is even possible?

I was hoping to use the “As BP ThirdPersonCharacter” to specify a component like a collision box. I can drag off that dot and get a reference to it, but I have no idea what to do from there? What is the next step?

I’d swear I’ve seen something like this in a tutorial once, but I have no idea how to set that up.

can you explain in simple terms what you want to happen in the game?

I’m trying to create something that’s almost exactly like Super Mario, and there are two situations you have to deal with when it comes to enemies. If you bump into an enemy it deals damage to you, but if you jump on its head you kill it.

The way I have it set up it “sort of” works. The capsule component on Mario blocks the enemies and when you hit the collision block on their head it kills them. Great!

But, the problem is that its very easy to get an accidental overlap and kill them just by standing next to them.

The ThirdPersonCharacter’s capsule component is just too big for this particular situation, its like using a sledgehammer when you needed a pair of tweezers.

So, the work around I’m trying to implement here is a small “enemy killing collision box” around Mario’s feet. Something low enough that it couldn’t possibly collide with anyone’s head and accidentally kill an enemy when you’re just walking around.

I was just hoping there was a way to cast to that specific collision box. …or if there’s any other way to go about this I’m open to any ideas.

Ah gotcha.

So, caveat, I haven’t done something like this before but I’ll make a suggestion. It may not be the best way but it should be a way.

You can add a tag to each collision box component on the enemy character. Just select the component you want and in details search “tag”:

So if you have a collision box that just covers the head you might select that and add a tag “head.”

Then, on the overlap event, pull from the Overlapped component and search “has tag” and then use == to make sure that you are hitting the “head” tagged component.

That should make for a simple method to identify a component that has been overlapped.

Just thinking a little more into your use case, but you might also have some conditional check to make sure the character is in the air - that might protect against accidental collisions without you needing to have to get fussy with multiple collision boxes. E.g., check if character is grounded, if not then they must be in air, therefor if overlapped with enemy, allow the “squash” event or whatever to happen.

1 Like

BIGTIMEMASTER, Thank you so much. That is a brilliant solution!!! …and it works! I’ve been testing for about half an hour and I’ve only accidentally killed two enemies. That is a dramatic improvement!! These guys used to die if you breathed too hard in their direction.

I’ve actually tried the In air check before, but it didn’t work because the enemies are too short, and its way too easy to get bumped into the air by a stray collision.

I think using tags like this is the perfect solution. I just wish I knew about this when I was making the nightmarishly complex power up system!

great to hear it’s working.

you’ll probably find a better solution just through testing. Maybe check to make sure character is a certain height above enemies, or a certain velocity, or a certain range of angles, or a little bit of each.

shouldn’t be too hard to get 100% predictability though.