Hi, I have a GameObject named CharacterJig, and I am dropping this script on it:
private var charController : CharacterController;
function Update()
{
charController = GetComponent(CharacterController);
if (charController.isGrounded)
{
}
}
Though, during play I get this error:
MissingComponentException: There is no 'CharacterController' attached to the "CharacterJig" game object, but a script is trying to access it.
If I remove the If statement, it does not error. What is wrong with this code? I am simply trying to get the game to detect if the game object is touching the ground.