Register in the constructor = OK || Register in BeginPlay = Double Overlap Events

If I register the overlap in the constructor it all works fine, I get one single log message.
If I register the overlap in Begin Play the log shoots twice for each action.

Begin play is not running twice.
I have already recompiled from scratch, closed the engine, rebooted the PC, when registering from begin play I always get double the logs.
Insanely weird, can someone explain what is happening ?

1 Like

BeginPlay is, in fact, effectively ‘running twice’ (that is, it’s running once on each connected client) – because a game, by its nature, must ‘begin’ for each individual player.

A class is only constructed once, at runtime, and therefore it will only call BeginOverlap and EndOverlap once, and only for the local client. That’s my understanding of the process, at least.

To stop the log from reporting twice in BeginPlay, add an authority guard ( (if (HasAuthority() ) to the log message; that should ensure that only the server has permission to write to the log.

Note, however, that HasAuthority will not prevent log output from appearing twice if a given instance of PlatformsToTrigger is populated by references to two identical platform actors; it’s a good idea to occasionally double-check that you’re not trying to trigger the same platform twice on one trigger.

Privacy & Terms