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
- Shader Graph Asset icon is not shown on creation unless you confirm the name
- APV Sky occlusion doesn't consider the terrain
- [iOS] "EXC_BAD_ACCESS" Player crash when Script Debugging is enabled
- Cursor skips input fields when tabbing between two sets of input fields
- "Shader error redefinition of 'Varyings'" error appears when selecting the shader
Add comment