This Creates a Race condition with the Network

    public void Update()
    {
        if(playerCameraTransform != null) { return; }

        if(NetworkClient.connection.identity == null) {return;}

        playerCameraTransform = NetworkClient.connection.identity.GetComponent<RTSPlayer>().GetCameraTransform();
    }

The NetworkClient line produces the race condition.
As this is related to the camera i thought this should always be done in late update to avoid this issue.
Moved it to Late update and the problem does not occur.

5 Likes

Privacy & Terms