|
var speed = 6.0; var jumpSpeed = 8.0; var gravity = 20.0; var run = 10.0; var slow = 3.0; private var moveDirection = Vector3.zero; private var grounded : boolean = false; function FixedUpdate() { if (grounded) { // We are grounded, so recalculate movedirection directly from axes moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); moveDirection = transform.TransformDirection(moveDirection); moveDirection *= speed;
} @script RequireComponent(CharacterController) This is my whole script so far everything is working except when i try to get my character to crouch nothing happens and the speed doesnt decrease like i want it too if you can see the problem please let me know.
(comments are locked)
|
