Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug jumping on slope in a 3D platformer

Discussion in 'Physics' started by enma0, Jul 5, 2022.

  1. enma0

    enma0

    Joined:
    Jul 5, 2022
    Posts:
    2
    Hi, I've been struggling with this problem for a while now, where the player can jump on slopes and they stand on them but then they can jump again as if they were grounded. I tried to solve this by adding physics material with 0 friction which didn't work. and I also tried a raycast method, which checks if the player is on a slope that is higher the angle accepted, but the raycasting itself didn't work. so I'm not sure how I should work around this.
     
  2. n_gon

    n_gon

    Joined:
    Oct 8, 2020
    Posts:
    10
    Rigidbody or Character Controller?

    If you're using a Character Controller correctly, this issue is resolved with the default implementation. But a lot of people don't code it right and end up with this problem where the player sticks to inclines.

    Post the code where you move the player based on input.
     
  3. enma0

    enma0

    Joined:
    Jul 5, 2022
    Posts:
    2
    I'm using both this Character controller and a Rigidbody, now I didn't write the script for the Character controller, but I did try to play with it to solve this problem, and I understand how most of it works. this is probably a bug in the Rigidbody, but I'm not certain of it.