- Home /
Cube starts shaking when placed on a giant sphere
Hi all,
I'm trying to place a cube of scale 1, 1, 1 on top of a sphere that is scaled 1000, 1000, 1000, however, I'm encountering a problem where it keeps shaking and slowly rotating/moving when it is on a surface of a sphere.
I tried it with the Rigibody gravity and using a custom gravity script that makes sphere a center of gravity (as sphere represents the planet). In both cases, the cube starts shaking so I assume it is not related to my gravity script.
The only explanation that makes sense at the moment is that the cube's flat surface is touching only a small point of sphere collider at each given time moment and that causes the shaking?
Anyone knows how could I prevent that (preferably without using a custom script to lock and unlock GameObjects as that sounds more like a workaround than a solution)?
Already tried changing almost all settings in the Project Settings > Physics tab. Also tried changing mass of cube, its drag, and angular drag - this can solve the issue, however, only when values are high enough to make cube almost impossible to move at all.
Video demonstrating the issue: https://youtu.be/KWNiM5r3C_o - there are 2 copy-pasted cubes, one using Rigidbody gravity and another one using custom gravity script (P_Gravity).
Answer by GintarasOE · Jul 22, 2020 at 04:17 PM
So,
As no one answered, my solution was just replacing sphere collider with Mesh collider. In my case, as the sphere is kinematic and relatively simple (less than 10k vertices) it doesn't have a noticeable impact on performance so it's more or less fine. Although not sure if that would be a suitable solution for mobile platforms (as performance is more important there).
Anyways, if anyone comes up with a better solution, please let me know and I'll change the accepted answer.
Your answer
Follow this Question
Related Questions
Making a cube fall without rigidbody 1 Answer
Object goes through wall. 0 Answers
How to disable this "friction"? 2 Answers
False collision at the edge of hole when using high gravity value 1 Answer
How to stop sphere from clipping through cube edges aside from lowering Time.FixedDeltaTime? 1 Answer