Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Wheel Collider and Slants/Slopes

Discussion in 'Physics' started by xcycle, Jan 27, 2022.

  1. xcycle

    xcycle

    Joined:
    Sep 25, 2018
    Posts:
    4
    Hi devs,

    I'm currently developing a simple vehicle game and I'm using the build in Wheel Collider for my vehicle.
    All in all it works fine so far, but there seems to be a problem with slants / slopes. Maybe just a point of correct configuration, but I don't get it work.

    When my vehicle stand still in front of a slant (a simple Cube object with rotation x = -30) and I move the vehicle forward it can't climb up the slant. The front wheels are going onto the slant but then the Wheels are spinning wild, but the vehicle is not moving anymore.

    The mass of the rigidbody is set to: 2200
    The motorforce for all 4 wheels is set to 1200

    wheel.collider.motorTorque = verticalInput * motorForce;


    I already increased the motorforce to 3000, then the vehicle is climbing very slowly up.

    What can I do to let the vehicle drive upwards on a slope?
     

    Attached Files:

    Last edited: Jan 27, 2022
  2. unity_44234FBC39E5661FBF5B

    unity_44234FBC39E5661FBF5B

    Joined:
    May 11, 2021
    Posts:
    29
    Try increasing the forward friction of the wheels
     
  3. xcycle

    xcycle

    Joined:
    Sep 25, 2018
    Posts:
    4
    Thank you for your fast answer. I set the friction to 1,2,1,2,1 but there is no difference :(
     

    Attached Files:

  4. unity_44234FBC39E5661FBF5B

    unity_44234FBC39E5661FBF5B

    Joined:
    May 11, 2021
    Posts:
    29
    try increasing the extremum slip.
     
  5. xcycle

    xcycle

    Joined:
    Sep 25, 2018
    Posts:
    4
    I increased extremum slip to 100 and after that to 1000. The wheels are spinning heavily then, much more than before.
     
    Last edited: Jan 31, 2022
  6. unity_44234FBC39E5661FBF5B

    unity_44234FBC39E5661FBF5B

    Joined:
    May 11, 2021
    Posts:
    29
    Try watching this.