/// <summary> /// ici effectue la force au sol /// </summary> /// <param name="dirForce"></param> public void ChooseIfAccelerateOrVelocityChange(Vector3 dirForce, float ratio) { //Debug.Log("la ?"); MoveOnWallWhenAirMove(dirForce.normalized * Mathf.Abs(previousInput), ratio); return; Vector3 rigidbodyVelocity = rb.velocity; float dotResult = QuaternionExt.DotProduct(Vector3.right, rigidbodyVelocity); if ((QuaternionExt.DotProduct(Vector3.right, rigidbodyVelocity) >= 0 && playerInput.Horiz > 0) || (QuaternionExt.DotProduct(Vector3.right, rigidbodyVelocity) <= 0 && playerInput.Horiz < 0)) { //dans le sens MoveOnWallWhenAirMove(dirForce.normalized * Mathf.Abs(previousInput), ratio); } else { //inverse Vector3 addForce = dirForce.normalized * speedAcceleration * ratio * Mathf.Abs(previousInput) * Time.fixedDeltaTime; rb.AccelerateTo(addForce, maxSpeedConstante, ForceMode.Acceleration); } }