How I can switch the StateAuthority?

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Fusion.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

How I can switch the StateAuthority?

nebulatechhub
2022-06-12 11:38:23

In server user can change Network object property but In client user can not change the network object. In server "HasStateAuthority" showing true and client game showing false. But want to it showing also true in client also.. Plz plz plz help me.``****

Comments

WARdd
2022-07-18 21:44:27

I think this is only possible in shared mode, in that case you can use request state authority:

public async void GetAuthority() {

if(Runner.IsSharedModeMasterClient) {

Object.RequestStateAuthority();

while(Object.HasStateAuthority == false)

  await Task.Delay(100); // wait for Auth transfer

//do stuff with your new authority

}

}

Otherwise the server probably needs to handle whatever it is you want to do

Back to top