I'm trying to check if the player isLocalPlayer
but it's just returning false every time. I have a lobby system where two to four players can join and connect on a network, they then spawn into the game but when I control one player it affects the others.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;
public class Player : Mirror.NetworkBehaviour
{
void Start()
{
if(isLocalPlayer)
{
Debug.Log("IN LOCAL PLAYER!!!");
}
else{
Debug.Log("NOT LOCAL PLAYER!!!");
}
}
This player script is attched to the player prefab and I have it referenced on the NetworkManager.
Unity version 2021.3.5f1
I'd appreciate any help!