Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Child position problem under physics after overnight soak test

Discussion in 'Editor & General Support' started by magnetix, Jan 8, 2013.

  1. magnetix

    magnetix

    Joined:
    Apr 4, 2010
    Posts:
    102
    We have a vehicle with a rigidbody and some wheel colliders. After an overnight soak test, we discovered that one or more wheels on the vehicle had moved out to the side and no longer appeared to be attached to the vehicle. The vehicle still drives and the wheels turn, they are just not in their original positions. Has anyone else seen and/or solved this problem?

    I can add a script to enforce child object positions, but I cannot see why that should be a necessity. Could be a bug or quirk of Unity's physics/transform hierarchy?

    Thanks.
     
  2. magnetix

    magnetix

    Joined:
    Apr 4, 2010
    Posts:
    102
    It seems this was caused by floating point inaccuracy being fed back into the transforms by a custom script over a long time. I solved it by caching initial values and resetting them periodically (say, every 5 minutes or 30 minutes). Not ideal but it works well enough for now.