Switch Has Authority Returning Authority For Client
I set up a simple blueprint that should print "auth" or "rem" depending on the result of a Switch Has Authority call, and it is printing "auth" even on client side... I am testing this using the in-editor network simulation.
Blueprint and results below. Any ideas as to why this might happen?
asked Feb 17 '15 at 11:28 PM in Blueprint Scripting
Hi Parrot Wing,
This will depend on how you're spawning your HUD. Authority is a per-actor concept - if it's spawned on the client, that client will be considered the authority over that actor (note clients can't replicate entire actors to the server). If it's spawned on the server and set to replicate, when the client checks "Has Authority" for that actor, it should return remote.
Depending on what you're trying to do, you may be able to achieve the desired effect by calling "Is Local Player Controller" on the associated player controller instead.
There is a known bug, which should be fixed in 4.8, where player controllers were reporting incorrect authority during the "Begin Play" event. I'm not sure this is what you're seeing since it doesn't look like you're checking in a player controller blueprint, but in case it is, doing the authority check in the "Post Login" event of the game mode is a potential workaround. Note this event is only called on the server, so you may need to call your own replicated event from here to perform logic on the client.
answered Feb 18 '15 at 01:22 AM
Ryan Gerleve STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here