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
- ShaderGraph tab header changes the icon to the VFX Graph icon when ShaderGraph and VFX Graph with the same name are both opened
- The Build Profiles window has usability issues when the panel takes up less than 30% of the screen width
- Inconsistent ShaderGraph RGBA channels compared to the Inspector when "Alpha Is Transparency" is used
- Crash on "The GUID inside 'Assets/asset.png.meta' cannot be extracted by the YAML Parser." when opening the project
- Shadows disappear when looking at a certain angle in Scene view and using Cloud Shadows with Volumetric Clouds
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().