Component Overlap Component not working

In my game I have a skeleton enemy. If the enemy gets close to the player I want him to swing his weapon and see if the player is intersecting with the attack volume mesh that is attached to the enemy. For this I am using the ComponentOverlapComponent node. The object type I am looking for is called Destructible which the player capsule is set to use. Even if the player is inside the attack volume mesh the node still returns false.




Didn’t understand why are you not using just a simple OnComponentBeginOverlap event?

I think it’s because nothing is set to overlap in the player capsule. Have you tried moving all those block ticks to the overlap column?

That is what I have done now (temporarily). I want to spawn the custom collision shape (SM_AttackVolume) when the enemy strikes an attack, then see if the player is inside and apply damage. Then finally remove the SM_AttackVolume.

Still prints false even if I set all the object Responses to overlap for the player capsule.

1 Like
  1. Check that you don’t have a piece of code that changes collision properties runtime
  2. Make collisions visible to check their size

I just did a quick test on this

and it seems to work fine. Do you have this on tick?

No I dont use event tick. I use the event called “On See Pawn (PawnSensing)” that is hooked up to a AI MoveTo node and the the code is called from the On Sucsess pin. (My player is called BP_Hero).

Sorry, too many variables for me to figure out what could be the problem.

I assume you’re not moving your pawn to 0,0,0. So this is not the actual code.

I think you have to take it apart bit by bit. Overlap is not the same thing as hit, so what we talked about above still holds.

But you also have object types ( destructible ), and a class filter… Have you tested each of these thing as you introduced them?

Yes sorry I forgot to mention that I tested to use the class filter (this did not help so I have now set it back to None). The AI move to works node fine, the enemy is running up to the player and then the on success code is fired. But as you can see in the original post the player (outlined in black) is standing inside the volume but the ComponentOverlapComponents node till returns false. (enemy outlined in red)

Breaking down and testing is the key.

Something to make it much easier, is to test in simulate mode. Then you can just drag stuff around in the editor to see if it triggers, you don’t have to keep playing and waiting:

image

I will continue looking for solutions, thank you for your time!

1 Like

1: I will have to look in to this but I am very sure I don’t change any of the collision properties for the player capsule and 100% sure I don’t do it for the SM_AttackVolume.

2: In the second image from the original post the enemy is outlined in red and the player is outlined in black. The big box that the player is standing in is the collision shape that I am testing against.

Just checking, that shape you’re referring to here, a mesh component you want to overlap with. It does have collision right?

If you look at it in the static mesh editor, or with player collision view:

I am not sure if this is what you mean. When I open the static mesh I am using for the static mesh component (SM_AttackVolume) I see this. It might be hard to see in the picture here but when looking from other angles the shape is identical to the mesh.

I’m getting confused now. If you press F8 during play and look at the level in collision mode, you should see this as a collision box

This is what it looks like when I do that. The SM_AttackVolume seems to be working fine.

Ok. I’m not sure then. Sorry… :frowning:

Think I will have to look for another solution, thanks for the help anyway.

1 Like