Alright, I'm attaching this script to a GameObject named 'test' which has a character controller. Every frame it prints "Null" AND "test(UnityEngine.CharacterController)"
This is doing two things. Firstly it's giving me a Null Reference Exception every frame. Secondly it's confusing the hell out of me. Why this is being called up twice every frame? And why is one of them always null? Thanks for the help!
#pragma strict
var controller : CharacterController;
function Start()
{
controller = gameObject.GetComponent(CharacterController);
}
function Update()
{
print(controller);
}
↧