Question by
LSLT01 · Apr 07, 2016 at 05:58 AM ·
3drendererobject reference
Object reference not set to an instance of an object
I follow this tutorial to make the Maze.
I've already finished the "Placing Doors"part, but I have an error during runtime, all I get in the error is NullReferenceException: Object reference not set to an instance of an object, and there is the part of code:
using UnityEngine;
using System.Collections;
public class MazeWall : MazeCellEdge {
public Transform wall;
public override void Initialize(MazeCell cell, MazeCell otherCell, MazeDirection direction){
base.Initialize (cell, otherCell, direction);
wall.GetComponent<Renderer> ().material = cell.room.settings.wallMaterial;
}
}
Comment
$$anonymous$$azeWall.Initialize (.$$anonymous$$azeCell cell, .$$anonymous$$azeCell otherCell, $$anonymous$$azeDirection direction) (at Assets/Scripts/$$anonymous$$azeWall.cs:10)
check whether variable wall is assigned in the inspector.