OnComponentBeginOverlap not firing event

I posted this question on both reddit and the answerhub, so I feel a bit bad for spamming but I’d really like to find an answer since I’ve run out of things to try.

I’m testing on two objects that both use the UFO static mesh from the flight starter template. On both Static Meshes I’ve set the Generate Overlap Events, set CollisionPresets to OverlapAll, and set Simulation Generates Hit Events.

In my constructor I have:

I also have:

and

And later on, here is OverlapBegin

NotifyHit does work when the two things are set to BlockAll, and NotifyActorBeginOverlap works when they’re set to overlap all, but why don’t the components work?

Unfortunately NotifyActorBeginOverlap doesn’t work for me since it doesn’t have the HitLocation and HitNormal vectors or an FHitResult.

Do you make sure to attach the Planemesh to whichever actor owns it? That way the collision settings you set to ‘this’ is passed on to Planemesh.

It gets attached to the RootComponent of the actor.

Make sure your functions “ActorOverlapBegin” and “OnHit” are marked as UFUNCTIONS(), otherwise dynamic binding won’t work.

2 Likes

I was indeed missing the UFUNCTION() on the functions, but it still doesn’t work after adding them.

Here is my header snippet:

Here are my source snippets:

Does any variable or function not declared inside the overlap begin function also have to be made a UFUNCTION or UPROPERTY?

Try moving your binding (AddDynamic) from the constructor to BeginPlay().

That did it! Thank you much!

Thx mate that helped me too

Cheers

Thanks Man! Really Helpful!! It stuck me for days!