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.
-
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
- [HDRP] Assertion printed when Maximum Reflection Probe count is higher than 64 due to k_MaxCubeReflectionsOnScreen when Raytracing is enabled
- Seams are visible on the Water System when multiple tiles are used and their Surface type is set to River
- Matching Game View creates unsaved changes even though nothing to save
- AudioClips do not have path or GUID in Build Report and incorrect size is reported
- The rendered color of the preset differs from the preview color when adding a new swatch in the HDR Color Picker
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().