Search Issue Tracker
Fixed in Unity 5.0.2
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.
- Memory leaks and Editor crashes/freezes when using decimal values in Gizmos
- "The page you were looking for doesn't exist" message appears when trying to Sign in using Unity Hub/Editor
- [Regression] Enviroment lighting is broken in the 2017.4.27f1 version
- Usymtool does not support arm64e
- [Addressables] Exception is thrown when accessing AssetReference.Asset before the asset is loaded