- Home /
CharacterController had no enabled property
I'm confused by this error:
Assets/Scripts/Path/PathFollower.cs(43,20): error CS1061: Type 'UnityEngine.CharacterController' does not contain a definition for 'enabled' and no extension method 'enabled' of type 'UnityEngine.CharacterController' could be found (are you missing a using directive or an assembly reference?)
in code:
public void OnDisable () {
/* set current velocity to zero */
CharacterController controller = (CharacterController) collider;
if (controller.enabled == true) {
controller.SimpleMove(Vector3.zero);
}
I mean, the error is simple enough, I've tried casting to different components with no luck. But I can't help but notice that enabled is listed as a property of both Collider and CharacterController in the Unity Script Reference. Is the reference wrong, or am I making a mistake?
Answer by Eric5h5 · Nov 01, 2011 at 06:56 AM
Neither; you're using an old version of Unity.
Your answer
Follow this Question
Related Questions
OnCollisionEnter not working 1 Answer
Distribute terrain in zones 3 Answers
c# trigger collider makes character controller misbehave. 1 Answer
Multiple Cars not working 1 Answer