I have this crouch script I got from this link,
http://forum.unity3d.com/threads/48187-scale-character-controller-but-not-player
Here is the script,
var controller : CharacterController;
function Update ()
{
if (Input.GetKey ("c")) {
controller.height = 0.5;
controller.center = 0.25;
} else {
controller.height = 2.0;
controller.center= 0.5;
}
}
It’s supposed to shrink the character controller capsule, so that it can go under objects. But I keep getting this, “Cannot convert ‘float’ to 'UnityEngine.Vector3” I’m not sure what is means.
I know the problem is with those controller.center pieces. But they are really important because they keep the character from sinking into the ground. Thanks for reading, this crouch has been bugging me for quite some time.
-Rov