hi im new to programing and i was messing around with a checkpoint system and this error
NullReferenceException: Object reference not set to an instance of an object
PlayerPos.Start () (at Assets/PlayerPos.cs:12)
appears with the following code ---------------------------------------------------------------------------------
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerPos : MonoBehaviour
{
private Game_Master gm;
private void Start()
{
gm = GameObject.FindGameObjectWithTag("GM").GetComponent();
transform.position = gm.LastCheckPoint;
}
}
any idea why its showing up as its stopping my checkpoint system from working
↧