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

Rigidbody turns much faster in build

Discussion in 'Physics' started by HighTerrain-ObiWan, Jun 29, 2022.

  1. HighTerrain-ObiWan

    HighTerrain-ObiWan

    Joined:
    May 18, 2021
    Posts:
    3
    I recently built an exe for a space combat simulator game, and when playing the built version, the player's ship would turn uncontrollably fast. Input for pitch/yaw/roll is capped at a value of 1, so sensitivity can't be a factor. The torque is the same in the editor and in the build so I'm not sure why a rigidbody with what should be all the same attributes would accelerate faster in angular velocity.

    As for what's notably changed since the last build, I updated the project from a 2021 version(2021.1.17f1) of unity to the latest 2022 version (2022.1.61f).

    I have experienced weird changes in resultant angular velocity in the past, but that was from changing the ship model in blender to be larger(mass stayed the same), which made the ship turn drastically slower than before for some reason(even without any angular drag). I adjusted torque values to compensate then, but I don't want to have to change torque values all the time from testing in the editor to playing the built version.

    Thanks in advance for any help

    Quick edit, here's a quick snippet from the player control component's FixedUpdate():
    Code (CSharp):
    1. if (pitch > 0)
    2. {
    3.     playerBody.AddRelativeTorque(Vector3.right * -pitchStrength * Mathf.Abs(pitch));
    4.     heatToAdd += 5;
    5. }
    6. else if (pitch < 0)
    7. {
    8.     playerBody.AddRelativeTorque(Vector3.right * pitchStrength * Mathf.Abs(pitch));
    9.     heatToAdd += 5;
    10. }
     
    Last edited: Jun 29, 2022
  2. HighTerrain-ObiWan

    HighTerrain-ObiWan

    Joined:
    May 18, 2021
    Posts:
    3
    Quick update, I rolled the project back to an LTS 2021 version and the player ship turns at the same speed in the editor and build as it should do. To me this implies it's an issue caused either by the latest version, or the process of updating a project to that standard from older version I'd used before.