Is there anyway who knows why this is happening and how to be solved?
These are simply 2 box colliders clearly intersecting for no reason i know of.
A response will be very welcome.
Thats looks like a bug. Try deleting both cubes, save the scene/project and close. Open and try again creating new cubes. If the problem persist you can add other collider, like mesh collider, or a capsulle collider
Try going to Edit> Project Settings> Physics and change the “Min Penetration for Penalty” to a lower value. Keep it greater than 0 though other wise the cubes will constantly repel each other.
Can confirm this happens on my end, too:
- Create a new project with default physics settings
- Create an empty scene.
- GameObject > Create Other > Plane
- GameObject > Create Other > Cube
- Attach a Rigidbody to the cube
- Duplicate the cube
- Arrange the cubes directly above each other (and the plane)
When the cubes fall, they may penetrate each other slightly. I’d take a screen cap, but it would be a pretty close duplicate of OP’s.
This is because Unity’s physics simulation isn’t perfect. It is, after all, only a real-time simulation.
You can adjust your project’s physics settings a bit: