So I am currently having an issue with the Run on Server RPC and ownership. I was hoping someone could explain what the heck is going on or what I am doing wrong. I took time to study the Compendium created by Cedric (that thing is actually gold) before coming here but not sure what I am doing wrong.
From my understanding the RoS RPC will not run unless it is owned by either the player pawn or player controller. I have a weapon class that has a event called “Unequip Weapon”. If I call that event from the class itself the weapon is not destroyed but if I call the same event from the Player Character it works as intended.
Event Server spawn weapon - called from inventory comp on player character
Personally I would not put the burden of equipping/ unequipping on any of the items.
Delegate this task to an actor component that manages equipment in your character.
That way it’s owned by the player and it is responsible for the actions regarding items on the character.
It also keeps your items clean of extra code that is not needed. Think in the long run 1 component code vs all items code.
Calling the equipment component on the character from your player controller is the best bet for it to not have problems with ownership.
Thank you very much! I guess I was attempting to go about it all wrong. I created a new actor component that handles equipment just like you said and was able to getting it working pretty quickly.