Search Issue Tracker
By Design
Votes
0
Found in
2017.4.0f1
2018.3.0a1
2018.3.7f1
2019.1.0a1
2019.2.0a1
Issue ID
1135083
Regression
No
CharacterController overrides object's position when teleporting with Transform.Position
How to reproduce:
1. Open attached project ("CharacterControllerTransform.zip")
2. Open SampleScene
3. Play
4. Use WASD to move and Space to transform to (0,0,0)
Expected result: Character transforms to (0,0,0).
Actual result: Character sometimes stays in the position it was.
Reproducible with - 2017.4.24f1, 2018.3.10f1, 2019.1.0b8, 2019.2.0a9
Note: only reproducible in the Editor.
Comments (3)
-
SZtamjan
May 27, 2024 21:06
Turns out Rigidbody's interpolation does exactly the same when you're trying to set new transform to the object with such configured Rigidbody. Right after seting the new transform to the object, call Physics.SyncTransforms and it should work perfectly fine.
-
hbashiri
Dec 24, 2023 06:35
The same issue in 2021.3.13 in both the editor and the build version. It's not even consistent, sometimes it happens and sometimes it doesn't. I guess it depends on the frame rate and when my start calls
-
JampotDev
Oct 02, 2022 13:26
I'm having the same issue in version 2021.2.16f1, a version that isn't on the list. I fixed it by syncing manually by calling Physics.SyncTransforms.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “New Scene” window UI breaks when minimizing
- Color Picker AuxWindow Resizes With Visual Glitches When Expanding Dropdowns
- [DX12][XR] Foveated rendering does not work if Shadows and Post Processing are enabled on DX12
- Visual Element expands beyond the parent element when width is set to auto
- Visual Element fails to encapsulate all children when using "flex-direction: row"
Resolution Note:
The problem here is that auto sync transforms is disabled in the physics settings, so characterController.Move() won't necessarily be aware of the new pose as set by the transform unless a FixedUpdate or Physics.Simulate() called happened in-between transform.position and CC.Move().
To fix that, either enable auto sync transforms in the physics settings, or sync manually via Physics.SyncTransforms right before calling Move().