Download

Help changing Owner to an Actor

I have a problem understanding how to change the owner of an actor. For instance, I want a certain player to not see some widgets so I am using this code inside the Actor with the widgets, and then I plan on using Owner No See. But I have tried everything and I can’t seem to make the Actor have a new owner. How do you do this?

Unless the player character is of the class 0_Vampire, In order to properly cast to that 0_Vampire, you need to be using an actor of that class type on the left pin.

I have a Vampire player and 4 villagers. The Vampire should not see some stuff that the villagers can. So I am trying to get the Vampire owner to also own the actors I am trying to hide from him.

Only the Server can change the Ownership so you need to ensure that it is only the server that runs Set Owner on behalf of the Vampire player.

It’s set up like this:

The “Switch has Authority” should be moved to after BeginPlay and SRVChangeOwner should not be an RPC (Remote Procedure Call) event but just a regular event.

It will not change the current behavior much since a RunOnOwningClient event would only run on the server anyway. Is the Actor marked as Replicates and is it currently relevant? Try to mark it as “Always Relevant”

Unfortunately still not working. I have tried all combinations of setting this logic up, but with not success.

Check the logs for warning or errors related to networking. It should be logged if “Set Owner” failed.