Search Unity

Any way to change wheel collider raycast direction?

Discussion in 'Physics' started by Xhitman, Aug 3, 2020.

  1. Xhitman

    Xhitman

    Joined:
    Oct 30, 2015
    Posts:
    452
    Or any other suggestion for my case?

    The robot transform to tank, the pivot direction change as shown.
     

    Attached Files:

  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    There's no way to change the WheelCollider raycast direction. It's vertically down with respect to the rigidbody it belongs to by design.

    The only workaround would be attaching the wheel to a rigidbody, then attaching that rigidbody to the vehicle's rigidbody with a joint. You could then rotate the wheel's rigidbody freely using the joint.
     
    Xhitman likes this.