Question by
rahel · Dec 04, 2015 at 03:54 PM ·
instantiateinheritancenull reference exceptionaccessing from any scriptnullreference
"I am getting a null reference exception error for Pathfollowertest.instance.centerslot.Add(Cube.transform)
using UnityEngine;
using System.Collections;
public class InfiniteObjectManager : MonoBehaviour
{
public Rigidbody cube;
public static InfiniteObjectManager instance;
Void Start()
{ GameObject Cube = Instantiate(cube, transform.position, transform.rotation);
Pathfollowertest.instance.centerslot.Add(Cube.transform);
}
}
public class Pathfollowertest : MonoBehaviour
{
public static Pathfollowertest instance;
public List centerslot;
}
Comment