Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Wheel collider sinking in the ground problem

Discussion in 'Physics' started by bobi_z_nairobi, Jun 13, 2018.

  1. bobi_z_nairobi

    bobi_z_nairobi

    Joined:
    Jul 18, 2017
    Posts:
    5
    Hi there!
    I have a serious problem with my game. I am writing a trials remake and everything works fine, except for the wheelcollider. It behaves fine, when I ride on flat surface. When I fall and land not parallel to the ground, the wheelcollider sinks in the ground, then it bounces my motorbike away. I also tried to add extra sphere colider to prevent from sinking in the ground, increasing fixed timestep, but nothing helped.

    I dont event have to go very fast to make this happen.
    Please, help!



    upload_2018-6-13_17-22-25.png
     
  2. NDSno1

    NDSno1

    Joined:
    Dec 20, 2014
    Posts:
    173
    Hello.
    From what I've seen , the problem is in the way Wheelcollider works, or rather essentially what it is, is not a wheel but only a raycast down to detect ground and simulate suspension spring effect. So when it's on flat ground, everything is fine because the ray goes down perpendicularly with the ground. But when the ray and the ground are not perpendicular, the above happens.
    I have been only using wheelcollider for cars with fairly low normal angle, so I'm afraid I don't know the best solution.
    One thing I can suggest is to have a script that rotates the WheelCollider according to the relative angle between the bike heading and the ground.
     
  3. bobi_z_nairobi

    bobi_z_nairobi

    Joined:
    Jul 18, 2017
    Posts:
    5
    That could work, but there is just one problem, the wheelcollider cant be rotated. It looks like it raytraces -y in world space.