Hi, im working with a game manager who gets a player transform and a player prefab, i can assign these variables in the inspector directly, i worked with it in one scene and it work perfectly, but i tried to use in another scene and i have an Unassigned Reference Exception it says my variable PlayerSpawnPoint has not been assigned and probably need to assign in the inspector, but i don´t know why, because in the inspector te transform is assigned.
Here is the code of my class:
public Transform playerSpawnPoint;
public GameObject player;
public static GameManager instance { get; private set; }
private void Awake()
{
if (instance == null)
instance = this;
}
// Start is called before the first frame update
void Start()
{
instance = this;
player = GameObject.FindGameObjectWithTag("Player");
player.transform.position = playerSpawnPoint.position;
}