Community Tutorial: How-to deal with Overlap on Spawn failure

Easy way to fix failure for situation when game starts and some action should happen if player is in trigger volume box.
Made for 4.27, compatible for Unreal 5.

1 Like

Faced the same problem, here is the solution: set in collision presets the object you need to ignore (for me it was pawn), and then in begin play set collision response to channel to overlap

Using IsOverlappingActor only works when you know the actors that you want to test and on level streaming.
In this case you are testing the player, so it’s easy to get but in some cases the problem persist.

I have made some test and the functions such as IsOverlappingActor or GetOverlappingActors are both not returning the correct value when spawning the collider on top of characters.
When the collider is large the characters are inside of it and not detected as overlapping unless either the Character or the Collider moves.

If you want to detect Overlaps on existing actors you need to use the function GetOverlappingComponents from your collider. ( GetOverlappingActors does not work because it only returns actors that have newly entered the collision volume since the last frame ).

On the receiver actors make sure you have another component (for example the Mesh) with GenerateOverlapEvents set to true and the collision channel set to “CharacterMesh”.

Then on loop through the elements returned by GetOverlappingComponents, get the owner actor of the overlapped component and process what you want to do with it.