Can 'position squishing' be prevented when using Rigidbody.movePosition()?
I have a very simple physics test scene, comprising of a rigidbody-enabled sphere, and a static/immoveable cube, both with their default colliders. I have a basic script to support mouse dragging to move the sphere around the scene (limited to 2 axis via plane raycasting).
This works great, I can move the sphere around and it will respect the box's bounds when using .movePosition() during a FixedUpdate. Unity's collision detection prevents the player from dragging the sphere into the cube, by keeping the sphere at the closest point possible to where the mouse is positioned over the cube.
Though, the problem is that this process appears to allow the sphere to slightly be within the cubes bounds, only marginally (maybe 10% of it's radius) during the drag event. Upon completing the event, the sphere will instantly "pop" back out from the cube and carry out any other gravity/physics as expected.
It appears that this is almost to support the "bounce" or "impact" of these two objects. Can this be disabled? I first thought it may be because of the physics material assigned to the sphere, it has some bounciness, but removing this material had no effect.
Your answer
![](https://koobas.hobune.stream/wayback/20220612100545im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why Does Bounciness Affects Rigidbody Velocity? (SOLVED) 0 Answers
Spawned objects sink through ground, when over 3 clones 0 Answers
Ball Bounce And Rotating Walls 0 Answers
Another Physics.OverlapSphere question 0 Answers
how would I make a capsule rotate and go down a platform on the y axis? 0 Answers