Hey Guys, crr. i had the problem that my CharacterController ist not Jumping when you walk (runspeed = 1)... If you Run (rs = 2) or stand in idle (rs = 0) it works. Maybe anyone can take a look inside and can help me with the soluton Thanks a lot Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(Rigidbody))] [RequireComponent(typeof(CapsuleCollider))] [RequireComponent(typeof(Animator))] public class NewController : MonoBehaviour { Rigidbody myRigidbody; Animator myAnimator; CapsuleCollider myCapsule; float forwardAmount; [SerializeField] float runCycleLegOffset = 0.2f; #region InputSettings public float vertical; public float horizontal; #endregion #region MovementSettings //public bool run = false; [SerializeField] public float runspeed = 0; [Range(1f, 4f)] [SerializeField] float GravityMultiplier = 2f; public float JumpPower = 6f; #endregion #region StateSettings public bool isCrouching = false; public bool isJumping = false; [SerializeField] public float distanceToGround = 0.1f; [SerializeField] public float groundCheckDistance = 0.2f; public bool isGrounded; float CapsuleHeight; Vector3 CapsuleCenter; const float k_Half = 0.5f; #endregion #region Debug public float extraGravityForce; #endregion Debug #region CameraControll private float mouseX, mouseY; public float mouseSensitivity = 10f; public float mouseYPosition = 1f; private float zoom; public float zoomSpeed = 2; public float zoomMin = -2f; public float zoomMax = -10f; public float rotationSpeed = 5f; public Transform playerCamera, playerCharacter, centerPoint; #endregion CameraControll // Use this for initialization void Start() { myAnimator = GetComponent<Animator>(); myRigidbody = GetComponent<Rigidbody>(); myCapsule = GetComponent<CapsuleCollider>(); CapsuleHeight = myCapsule.height; CapsuleCenter = myCapsule.center; myRigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; zoom = -4; } // Update is called once per frame void Update() { zoom += Input.GetAxis("Mouse ScrollWheel") * zoomSpeed; if (zoom > zoomMin) zoom = zoomMin; if (zoom < zoomMax) zoom = zoomMax; playerCamera.transform.localPosition = new Vector3(0, 0, zoom); mouseX += Input.GetAxis("Mouse X"); mouseY -= Input.GetAxis("Mouse Y"); mouseY = Mathf.Clamp(mouseY, -60f, 60f); playerCamera.LookAt(centerPoint); centerPoint.localRotation = Quaternion.Euler(mouseY, mouseX, 0); centerPoint.position = new Vector3(playerCharacter.position.x, playerCharacter.position.y + mouseYPosition, playerCharacter.position.z); CheckGroundStatus(); Move(); Crouch(); Jump(); if (!isGrounded) { myAnimator.SetFloat("Velocity", myRigidbody.velocity.y); } if (Input.GetAxis("Vertical") > 0 | Input.GetAxis("Vertical") < 0) { Quaternion turnAngle = Quaternion.Euler(0, centerPoint.eulerAngles.y, 0); playerCharacter.rotation = Quaternion.Slerp(playerCharacter.rotation, turnAngle, Time.deltaTime * rotationSpeed); } forwardAmount = vertical; float runCycle = Mathf.Repeat(myAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime + runCycleLegOffset, 1); float jumpLeg = (runCycle < k_Half ? 1 : -1) * forwardAmount; if (isGrounded) { myAnimator.SetFloat("JumpLeg", jumpLeg); } } private void FixedUpdate() { vertical = Input.GetAxis("Vertical"); horizontal = Input.GetAxis("Horizontal"); } void Move() { if (Input.GetKey(KeyCode.LeftShift) && !isCrouching) { if (runspeed < 2 && vertical != 0) { runspeed = runspeed + 2.5f * Time.deltaTime; } } else { if (runspeed > 1 && vertical != 0) { runspeed = runspeed - 1.5f * Time.deltaTime; } else { runspeed = 1; } } myAnimator.SetFloat("Speed", runspeed * vertical); myAnimator.SetFloat("Direction", runspeed * horizontal); } void Crouch() { if (Input.GetKeyDown(KeyCode.C)) { isCrouching = !isCrouching; } if (isCrouching) { if (vertical == 0 && horizontal == 0) { myCapsule.height = CapsuleHeight / 1.7f; myCapsule.center = CapsuleCenter / 1.7f; } else { myCapsule.height = CapsuleHeight / 1.5f; myCapsule.center = CapsuleCenter / 1.5f; Debug.Log("Crouch"); } } else { myCapsule.height = CapsuleHeight; myCapsule.center = CapsuleCenter; Ray crouchRay = new Ray(myRigidbody.position + Vector3.up * myCapsule.radius * k_Half, Vector3.up); float crouchRayLength = CapsuleHeight - myCapsule.radius * k_Half; if (Physics.SphereCast(crouchRay, myCapsule.radius * k_Half, crouchRayLength, Physics.AllLayers, QueryTriggerInteraction.Ignore)) { isCrouching = true; return; } else { myCapsule.height = CapsuleHeight; myCapsule.center = CapsuleCenter; } } myAnimator.SetBool("isCrouching", isCrouching); } void Jump() { if (Input.GetKeyDown(KeyCode.Space) && isGrounded != false) { myRigidbody.velocity = new Vector3(myRigidbody.velocity.x, JumpPower, myRigidbody.velocity.z); //DEBUG Debug.Log("Space pressed..."); Debug.Log("New Vector: " + myRigidbody.velocity.x + ", " + JumpPower + ", " + myRigidbody.velocity.z); } } void CheckGroundStatus() { RaycastHit hitInfo; if (Physics.Raycast(transform.position, -Vector3.up, out hitInfo)) { distanceToGround = hitInfo.distance; } if (distanceToGround <= 0.2f) { isGrounded = true; myAnimator.applyRootMotion = true; } else { isGrounded = false; myAnimator.applyRootMotion = false; } myAnimator.SetBool("isGrounded", isGrounded); } void HandleAirborneMovement() { // apply extra gravity from multiplier: Vector3 extraGravityForce = (Physics.gravity * GravityMultiplier) - Physics.gravity; myRigidbody.AddForce(extraGravityForce); Debug.Log(extraGravityForce); } }