Search Issue Tracker

Won't Fix

Votes

4

Found in

2022.3.21f1

2023.2.15f1

6000.0.0b12

Issue ID

UUM-67811

Regression

Yes

RigidBody GameObject's position gets randomly reverted when transform.position in Update() is used

-

Reproduction steps:
1. Open the attached “PhysicsRepro.zip” project
2. Open the “SampleScene” scene
3. Enter the Play mode
4. Press the “Space” button and observe the Cube’s movement

Expected result: The Cube gets teleported with no glitching
Actual result: After a few button presses, the Cube starts glitching or stops moving, even though the Console shows the "Teleported cube!" log

Reproducible with: 2022.1.0a6, 2022.3.21f1, 2023.2.15f1, 6000.0.0b12
Not reproducible with: 2021.3.36f1, 2022.1.0a5

Reproducible on: Windows 11
Not reproducible on: no other environment tested

Notes:
- Sometimes it takes to press the “Space” button 5-10 times for the issue to appear
- Changing the “Fixed Timestep” in Time settings from 0.02 to something like 0.005 makes the issue more apparent
- Reproducible both in the Editor and the Player
- A possible workaround is to set Rigidbody.position every time the position of a transform that has Rigidbody attached changes, this prevents the issue since the position is manually synced to the physics engine
- The reporter also noted another workaround - manually calling Physics.SyncTransforms after changing transforms and calling it once every frame in LateUpdate. This workaround can be tested by enabling “== ENABLE THIS STOP THE ISSUE ==” GameObject, however, this workaround doesn’t work in all situations
- This issue also causes NPC ragdolls to "explode" glitching out across the whole screen when they are switched from animated walking around to ragdoll mode
- Not reproducible when the Rigidbody “Interpolate” property is set to “None”

  1. Resolution Note:

    Explained here: https://blog.unity.com/engine-platform/expanding-the-robotics-toolbox-physics-changes-in-unity-20221 in the interpolation section. We no longer force sync all transforms each Update when there are interpolated bodies in the scene.

Add comment

Log in to post comment