Search Issue Tracker
Fixed in 5.0.2
Votes
0
Found in
5.0.0f4
Issue ID
690124
Regression
No
MovePosition: gravity moves transform, not rigidbody
To reproduce in the attached project:
1) Play the "mainscene" scene in the "Assets" folder
2) Make sure the "Do Null Moves" box on the Player script (on the Player gameobject) is unchecked.
3) Once gravity has moved the player down to the platform, use the left and right arrow keys to move the Player via MovePosition.
4) Observe the buggy behavior -- the Player's sprite will penetrate the platform by about 1 frame's worth of gravity. The penetration is not cumulative, and corrects one frame after letting up on the movement keys (probably as the transform used for rendering resyncs with the Rigidbody's position)
5) Replay the scene from the start, this time checking the "Do Null Moves" box. This will make it so that MovePosition will be called even if there is no movement needed (the Player will simply do MovePosition to the rigidbody's current position).
6) Note that the player is perpetually one frame's worth of gravity BELOW its starting position. The fact that the Player is not consistently moving DOWN indicates that gravity is moving the TRANSFORM of the Player, but not the rigidbody*. This behavior is potentially responsible for the penetration (and delayed correction) produced in steps 1-4. This shows that the behavior has nothing to do with collision (since steps 5-6 do not produce any collisions).
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Rendering locks up when not looking at a transparent material on Meta Quest 2
- Volumetrics break when using a Custom Pass to create a Thickness Buffer for Alpha Clipping
- All tests are run instead of only the failed ones when the "Rerun Failed" button is pressed
- GameObject is not masked when the "Render PostProcessing Effects" pass executes with a resolved non-MSAA Color target and MSAA DepthStencil target
- [Android] Gfx.WaitForGfxCommandsFromMainThread high performance usage and inconsistency when built Player scene has Canvas GameObject on a specific Project
Add comment