OnComponentHit.AddDynamic for subobject component not firing

Hello again, somewhat beginner game programmer here. I have a player character with subcomponents that I want to use to detect hits with. The detection will fire an OnHit function within the main player cpp. I’ve done everything I can to check syntax, set generates hits to true on all components, and stuff like that. But not a single log message comes through. Can someone see what I’m missing?



I’m also wondering if it could be something to do with the hierarchy of objects or if maybe the hitbox isn’t actually moving with the player. I feel like since ourArm->SetupAttachment and stuff like that works would mean otherwise, but who knows.

Any help is super appreciated. I’m really confused because my classmate has a similar setup I’ve referenced, and other than setting physics to true (which I really don’t want for this object), everything seems to be the same. It’s his box object I’m trying to hit.

I have adjusted this to use OnComponentBeginOverlap (with the appropriate parameter corrections) instead and have done
ourArm->SetGenerateOverlapEvents(true);
but it still does not want to trigger.

The arm is set to object type vehicle and overlap everything. The other object is set to world static and block everything except overlap vehicles. Both generate overlap events.

I don’t know whats going on except maybe all the subcomponents are confusing it. As far as I can tell, everything matches and it should work. Adding screenshots of everything in case somebody catches something I missed.




Hey @GreenBaguette192

Some question about your Component is a UPrimitiveComponent?
Can you show me the header of your componente?

Looks like you component doesn’t have bounds.
You can do a quick check changing the parent to box component to see if you the overlap works.

The subcomponent/object is a UBoxComponent, so I definitely feel like it should have bounds.


I wasn’t sure exactly what you meant about the parent, but I tried setting armHolder to a UBoxComponent and it still did not detect overlap.

Resolved!!! Had to be in BeginPlay, which is strange because my classmates is in his constructor. Not complaining though!

1 Like