Search Unity

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

Question Wheel collider ignoring frontal collisions.

Discussion in 'Physics' started by ReguloRosado, Jul 13, 2021.

  1. ReguloRosado

    ReguloRosado

    Joined:
    Jul 17, 2020
    Posts:
    2
    I have a simple wheel collider, the issue is that it only accounts for contact with other colliders when this contact occurs along the axis of the 'suspension'. Ignoring collisions on the front part of the wheel until the suspension axis enters in contact with the other collider (thus causing the vehicle to suddenly/aggressively climbing the object).

    Picture of wheel collider 'merging' into other collider:
    upload_2021-7-12_19-49-38.png

    (same picture with a mesh renderer for the wheel):
    upload_2021-7-12_19-52-17.png

    picture of the moment after the suspension axis enters in contact with the other collider:
    upload_2021-7-12_19-53-1.png

    Please tell me if the provided information is not enough or the issue is not correctly explained.

    Thank you for your time.
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,477
    It's pretty much by design. WheelCollider in Unity uses a single vertical raycast for contact detection, so it detects obstacles only when the raycast is directly over the obstacle.

    PhysX, the underlying physics engine which implements the wheel collider, already developed and exposed a solution for this that has been available for years now:


    However, this solution has not been exposed in Unity yet because devs have other priorities and little interest on improving vehicle physics in Unity.

    More information here:
    https://forum.unity.com/threads/my-top-three-physics-feature-requests.584263/
     
    ReguloRosado and AlTheSlacker like this.
  3. ReguloRosado

    ReguloRosado

    Joined:
    Jul 17, 2020
    Posts:
    2
    Thanks @Edy !, that's some useful info.
     
    Edy likes this.