Search Issue Tracker

Fixed

Fixed in 6000.0.25f1, 6000.1.0a3

Votes

10

Found in

6000.0.24f1

6000.1.0a2

Issue ID

UUM-84990

Regression

Yes

Vehicle body is lifted way above wheels containing a WheelCollider Component when entering Play Mode

--

-

Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/SampleScene” Scene
3. Enter Play Mode
4. In the Game View, observe the “car“ GameObject

Expected result: The car’s body sits close to the top of the wheels
Actual result: The car’s body is lifted way above the wheels

Reproducible with: 6000.0.19f1, 6000.0.24f1
Not reproducible with: 2021.3.45f1, 2022.3.51f1, 6000.0.18f1

Reproducible on: Windows 11
Not reproducible on: No other environments tested

Note: Disabling and enabling the “car” GameObject, or making changes to one of the WheelCollider Components fixes the issue

Comments (4)

  1. deathwatchgamings

    Oct 25, 2024 08:33

    Another thing to note as I mentioned below about the jumpiness in the previous 2 provided "Temp Solutions" brought me to think that when I initially reported the same issue days ago I mentioned in that report that the issue it effects not just say the wheel collider but also center of gravity offset as you can reproduce by similar means and then by a manual cog offset edit when automatic center of mass is false then via such center of mass an edit to the input will drop the car as I mentioned such can be reproduced with even the car wheel colliders tutorial found in the Unity 6 docs just for example. So thinking on that and noticing the major jumpiness / drop stil presnet in the "Temp Resolutions" provided by both gghandi as well as myself, I then thought why not for now also zero out the car controller script existing centre of gravity offset so as to not remove or comment out that code in the controller and simply add such of the likes to the "Temp resolutions" to sort out the majority of the jumpiness and as such it does indeed reduce that extra lil bit of drop /jumpiness.

    ie: *

    Zero out the center of gravity offset in your car controller first centreOfGravityOffset = 0 so as to not need to comment in controller code

    Then same "Temp Resolution" as provided before but with COG

    using UnityEngine;
    using System.Collections;

    namespace TemporarilyResolve
    {
    public class COGWheelColliderEnabler : MonoBehaviour
    {

    [Header("Wheel Colliders")]

    [Tooltip("Add just one of any of the wheel colliders")]
    [SerializeField] private WheelCollider _wheelCollider;

    [Header("COG Offset")]

    [Tooltip("Zero out the center of gravity offset in your controller first as this replaces such for now")]
    [SerializeField] private float _centreOfGravityOffset = -1f;

    Rigidbody _rigidBody;

    private void Awake()
    {
    _rigidBody = GetComponent<Rigidbody>();

    _wheelCollider.enabled = false;

    float duration = 0.000001f;

    StartCoroutine(EnableWheelCollider(duration));
    }

    private IEnumerator EnableWheelCollider(float duration)
    {
    yield return new WaitForSeconds(duration);

    // Adjust center of mass vertically, to help prevent the car from rolling
    _rigidBody.centerOfMass += Vector3.up * _centreOfGravityOffset;

    _wheelCollider.enabled = true;

    }
    }
    }

    For my temp purposes that at least also reduces the annoying jumpiness/drop that was visibly bugging me with both of the previously provided "Temp Resolutions"

  2. deathwatchgamings

    Oct 23, 2024 23:03

    Same issue happening for me and as such I reported this issue days ago and as such the official response was it will be sorted soon.

    I also applied a similar "Temp Solution" like also mentioned above myself in the meantime

    ie:

    using UnityEngine;
    using System.Collections;

    namespace TemporarilyResolve
    {
    public class WheelColliderEnabler : MonoBehaviour
    {
    [Header("Wheel Colliders")]

    [Tooltip("Add just one of any of the wheel colliders")]
    [SerializeField] private WheelCollider _wheelCollider;

    private void Awake()
    {
    _wheelCollider.enabled = false;

    float duration = 0.000001f;

    StartCoroutine(EnableWheelCollider(duration));
    }

    private IEnumerator EnableWheelCollider(float duration)
    {
    yield return new WaitForSeconds(duration);

    _wheelCollider.enabled = true;
    }
    }
    }

    and yes, either or of the suggested "Temp Resolutions" will temp sort out the issue to a degree, though the jumpiness on the drop is highly noticeable especially on vehicles with more mass and such. Another thing these temp solutions do not factor is say an inactive vehicle, but regardless, hopefully the actual official fix that is in progress as of now will come shortly as was stated recently by email reponse to me today that such was indeed in progress.

  3. Dzianis

    Oct 22, 2024 21:35

    One note: It is reproducible for me in 6000.0.23f1

  4. ggandhi

    Oct 22, 2024 06:14

    Same Thing happening with me

    But for Temporary Resolution you can

    public class RefreshWheelCollider : MonoBehaviour
    {
    public WheelCollider wheelCollider;
    private void Start()
    {
    wheelCollider.enabled = false;
    StartCoroutine(WaitForFrame());
    }
    private IEnumerator WaitForFrame()
    {
    yield return new WaitForEndOfFrame();
    wheelCollider.enabled = true;
    }
    }

    This works as expected

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.