I was thinking about this more last night, I think the best solution might be.
- Client opens UI and selects item and makes call to server indicating it wants to use an item.
- Server spawns the item and calls “MulticastOnUsed()” on the item.
- 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.
- 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?