com.unity.netcode.gameobjects
com.unity.netcode.gameobjects copied to clipboard
IsOwner == false on client site locally
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
- 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
Changed version of unity, now it seems to work.