Download

Trigger Collision Box On Spawn

Hello!

Simple issue that I’m hoping has a simple solution. I have a blueprint that contains a collision box that when triggered with BeginOverlap and EndOverlap performs different tasks. My problem is that if my players spawns (from a PlayerStart) inside the box, BeginOverlap doesn’t trigger. Is it possible to make BeginOverlap work when the character starts inside the box, or if not what’s the best way to detect that the player has spawned within that box?

Cheers

You could check if player is inside collision box, when spawning, then manually trigger event.

Does adding a Delay when spawning the player trigger the event?

What would be the best way to detect once the player has spawned from inside the blueprint with the collision box?

Where would I add that delay? Is there a node I can add after switching levels?

The effect I’m trying to achieve is that the player can enter multiple different levels from one main level, but then when returning to that main level they spawn in where they left off. Would it be better to forgo the PlayerStart component entirely and position the player manually? (Effect similar to Skyrim where when you enter a house and then go back out you appear outside whichever house you entered)

The collision aspect comes in because once the player enters a house the roof disappears, but if I spawn the player in using PlayerStart then it doesn’t trigger the BeginOverlap event.

Some things to think about… You can spawn a Player manually using a Spawn Actor from Class node (where you can override or specify the spawn location). Typically you’d call this from Gamemode as that works both in Singleplayer and Multiplayer… What you’re doing right now most likely, is spawning automatically using Project Settings → Maps & Modes (which will use Player Start if one exists in the level).

However, If a start-up timing or glitch occurs (quite common btw), Overlap events may not fire until the after the level is fully loaded and the game has started and a Players enters the box fresh. So its worth trying the gamemode spawn option above, especially as spawning manually gives you the option or control to prevent Players from spawning inside the box at all. But if that’s what you actually want, and the overlap still isn’t working because the Player is being spawned there, then as Nawrot said you can extend your code and force an event to occur after spawning the player manually etc…