The player is mounted rigidbody. When climbing a steep slope, everything works as it should: the player cannot climb at a certain angle of the slope. But, if during the ascent you also jump (jumps with the help of addforce), then you can easily climb a steep hill. How can this be fixed?
public float jumpForce; Rigidbody rb; void Start(){ rb = GetComponent<Rigidbody>(); } void Update() { Ray ray = new Ray(transform.position + transform.up, -transform.up); if (Physics.Raycast(ray, 1.1f)) { if (Input.GetKeyDown(KeyCode.Space)) { rb.AddForce(Vector3.up * jumpForce); } } }