Client RPC handles earlier than BeginPlay[updated]

I am experiencing the exact same on my project. 1.) I spawn an actor on the server in a blueprint. 2.) Immediately after, i call a multicast RPC from blueprint. The RPC itself is implemented in C++.

First actor: Actor gets replicated, BeginPlay executes, RPC executes.

Second actor: Actor gets replicated, RPC executes, crash because RPC uses data initialized in BeginEvent.

Time between spawning of actors doesn’t matters. Happens 100% of tries.

I worked around it by having a BeginPlayCalled property, which is set to true at the end of BeginPlay and all client RPC’s check for this variable and if false, add the RPC to a event buffer and return out. The event buffer is executed at the end of BeginPlay. This fixes it reliably, but is quite some extra work.

I need some time to isolate code to have a project to replicate this behavior. Just a heads up that thiis problem is still existing as of 4.21.1 and “quick” workaround to get your project to work in multiplayer.