Hey y’all i have this c# script here: using UnityEngine;
using System.Collections;
public class DisablePlayerThings : MonoBehaviour {
public GameObject Playeryo;
// Use this for initialization
void start () {
Playeryo = GameObject.FindWithTag(“Player”);
}
void OnLevelWasLoaded(int level) {
if (level == 1)
Playeryo.GetComponent().enabled = false;
Playeryo.GetComponent().enabled = false;
Playeryo.GetComponent().enabled = false;
Playeryo.GetComponent().enabled = false;
if (level == 3)
Playeryo.GetComponent().enabled = true;
Playeryo.GetComponent().enabled = true;
Playeryo.GetComponent().enabled = true;
Playeryo.GetComponent().enabled = true;
}
}
and it only does its job (to disable a script on scene 1 and reanable it on scene 3) for the first script (Player) does anyone know why this happens?