com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

IsOwner == false on client site locally

Open flyingkaktus opened this issue 4 years ago • 1 comments

Description

I start the game as host and as client. The prefabs of the players appear on both windows. But on client side IsOwner is printed as false and OwnerClientID is always 0.

    public override void OnNetworkSpawn()
    {
        base.OnNetworkSpawn();
        Debug.Log("Is Owner? = " + IsOwner);
        if(!IsOwner) {
            Destroy(this);
        };
    }

Reproduce Steps

  1. Go to Unity Build

Actual Outcome

On the client side and on the server side, the Destory(this) is executed, written in the PlayerControll Script attached to the client player.

Environment

  • OS: win11
  • Unity Version: 2021.3.6f1
  • Netcode Version: 1.0.0

flyingkaktus avatar Jul 25 '22 22:07 flyingkaktus

Changed version of unity, now it seems to work.

flyingkaktus avatar Jul 27 '22 23:07 flyingkaktus