How do I trigger/retrieve overlaps when starting already overlapping?

I have a box collision inside of an Actor that’s placed in the level. This box is located at the same position that the player spawns. When first launching the level, I do not receive a Begin Overlap and if I check the list of overlapping actors in BeginPlay, it’s empty. If the player leaves the collision and returns, I get Begin Overlap as expected.

How do I get my overlaps in this case?

On begin play, you can use the get overlapped actors node on the actor with the collider/the collider itself, making sure the class filter is set to your player characters class, and then check whether that array has anything in it.

4 Likes

you could also start the player outside the overlap, the set the new location after a tiny delay (you could cover this up with loading screen).

if the overlapped actor is required for game logic to fire off correctly though, probably safest to just ensure that it gets referenced through code. Like a special function just to find it on begin play.

another weird idea is that you could set default scale of the overlap collision component to be small, then increase the scale to full size shortly after begin play

Huh, that’s so weird. This is what I did (the logic was still there when I went to go check) and it didn’t work before. It’s working now without changing anything. There must have been something buggy going on that required a restart. Anyway, sorted out now. Thanks for the help.