Overlap event when game start

I made overlap event with triggervolume. And player game start in trigger volume, overlap event is not working. How do overlap with game start?

Hey there @Huiro03! Colliders tend to ignore overlaps of anything they start out inside of for begin overlap because technically, they are overlapping it already so it wasn’t running when the overlap began. Instantiating something in an overlap volume works however.

What’s your use case for checking overlap when a player spawns? Since it’s an event at spawn, is there any other logic that could work? Is it guaranteed the player spawns in this volume? If so it could be a conditional after a begin play. Like say checking distance or if that volume exists.

1 Like

Players will be created in the open world game. Then, the trigger is present in the generated position, and the trigger is activated to set the lighting to fit the area. Overlap event is required because the lighting changes with the trigger volume. Players are randomly sponsored to different lighting area.

Hmm, I think I found a workaround
image

Try allowing tick before begin play. Seems like it worked out for the fresh trigger volume I made here.

1 Like

hmm… it’s not working.
Is there any other way to check inside the area other than overlap event?

Technically hits generate constantly, but you use that for blocks or traces not so much overlaps. I’ve got it working on this side for pre-spawned and post spawned actors now, so I just need to determine if it’s possible in 4.27 the way I set it up here. (Sorry just answered a 5.03 question before yours so I prototyped it there). I’ll give you a whole rundown of how I got it running in a moment if I can replicate that success here.

1 Like

Be careful, overlap functions structured as BeginOverlap and EndOverlap. So in logically, when game start you already start inside of volume, so you didnt begin or end from overlapping something. I suggest you different approach like, put very thin trigger box but little slightly far away from player and player cannot go further without touching it, so there you go.
Or you can use beginplay in level or any other event when triggered on desired time.

1 Like

Alright, got it! So I forget I had this enabled for another script I was testing for another member.
image

This should allow overlaps before beginplay when the level is just streaming in. This can cause ill effects if you move stuff around before play but does what you need!

3 Likes

It’s not working. I need to find a solution using the begin play event. Thanks!!

Hmmm, sorry about that. Might be something project specific on your side there. If you can’t figure anything out eventually, let me know and I can pass you the project itself for your own reference. Have a good one!

Hello I’m sorry if this is too late I do see what the CtnDev but I think we had the same issue and they are correct but there is a work around if it something you were looking for. So yes the Overlap need to have a beginning and an end based on the edge so what I did was at the beginning I had it grow to the size I needed. Using a timeline and a size float variable I changed the size of the collision component (or for you it could be the trigger) and added the event to begin play. This would ensure that everything has a begin overlap I hope this helps :slight_smile:

1 Like

Enabling “Generate Overlap Events During Level Streaming” does not completely solve the problem. Another simple method is to disable “Generate Overlap Events” for the collision box by default, and then enable it during BeginPlay

1 Like

That is not true. The actors do begin to overlap with one another. I’ll give you a very very clear example. Here’s tick 100 with 1 box on the screen:
UE4Editor_y7t6LWITSs

Does it overlap with any other actors? Well, obviously, no.

Here’s tick 101:
UE4Editor_iieBkC4d8U

Does this box on the screen overlap any other actors? Well, obviously, yes. Did it just start doing that - begin overlapping, after box #2 was spawned? Duh. Exactly. So the event should be triggered respectively. Also after they stop overlapping, respective end overlap event should be triggered.