Here is the script:
public void crouch ()
{
controller.height = crouchHeight;
controller.center = new Vector3 (0, -0.5f, 0);
mainCamera.transform.localPosition.y -= new float(crouchHeight);
crouching = true;
}
And Unity gives me this error:
Assets/Scripts/Crouching.cs(31,96): error CS1729: The type `float' does not contain a constructor that takes `1' arguments
Any Help?
↧