Download

Correct way to wait replication of an Actor ? *solved*

So,

Imagine i’ve got a Weapon, Actor, replicated.
I want to spawn it, then play with him (give him to a player for example).

In a perfect world, i will spawn him, and give by the constructor to who i want to give the weapon, and i will manage this inside weapon.

But imagine, for design reason, i want to manage him from my pawn.
Like : Server spawn the weapon > Server call a RPC Multicast inside my pawn to pick the item.

In this specifique case, it will fail, cause the RPC will be executed most of the time by the clients, before the spawn of the weapon is effective on them.
So, for this kind of case, how we should / want handle it ? or it’s bad at the point we should never manage thing like this.

Interessing discussion w/ @FooKing on discord :

A simple loop with == null should do the trick.