Monday, May 20, 2024
HomeGame Developmentphoton - Do I need to query HasStateAuthority?

photon – Do I need to query HasStateAuthority?


Following a Photon Fusion tutorial, I wrote this code:

    public override void FixedUpdateNetwork() {
        if (!HasStateAuthority) {
           return;
        }
        ...
    }

I thought the condition on HasStateAuthority comes to prevent a player to change the state of other players. So I thought that, without this condition, a player movement action would move the objects of all players in the scene.

However, when I remove this condition, I do not notice any change in movement: the player input actions still move only that player’s object, and not any other player.

Is it really needed to query HasStateAuthority?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments