How I can switch the StateAuthority?
The whole answer can be found below.
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).
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
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