Call a method on server spawned actor on all clients

I was thinking about this more last night, I think the best solution might be.

  1. Client opens UI and selects item and makes call to server indicating it wants to use an item.
  2. Server spawns the item and calls “MulticastOnUsed()” on the item.
  3. All clients and the server execute the MulticastOnUsed() method once the item actor is replicated and that calls a method back on the using pawn. This ensures the item actor pointer is valid.
  4. Finally, this calls the OnUsed() method on the item.

It’s not the cleanest solution (ideally, I would have liked the item base class to not have to contain any RPC calls), but I think it might be the best approach.

What do you think? Anything seem too convoluted there?