I have a planet as a big mesh with a rigidbody and Im attaching to it trees with ConfigurableJoints or fixedjoints and small breakforces.
When an object is in a relative sleep with the planet, it creates a fixedjoint and disables collision betwen the object and the planet.
The problem is that sometimes when creating this joint, all other joints break and I have no idea of whats going on with that.
A few questions…
- Is the planet moving?
- What is the mass of the planet and the tree object?
- How small is the break force?
Also, can you post the code you are using to create the joint and disable the collisions?
-
Is the planet moving?
Yes, the planet is moving and there is gravity so it orbits around a star.
-
What is the mass of the planet and the tree object?
In this case the mass of the planet is 1000 and the mass of the trees is 0.01 (the minimum mass). I tried other planet sizes and mass with same result.
-
How small is the break force?
Break forces and break torques of the trees are 0.1 .
I just noticed its not only when creating a new joint. I started the game and left the spacecraft over the surface of the planet and after a while noticed that it was progressively jumping over the surface as if there was a loss of precision in the collisions. Then I hitted the nearest tree and not only this tree but all trees and their joints broke.
So this loss of precision may be the cause? why is it happening?
It happens always after a few minutes. Even without trees and joints. Its like physic simulation is worse with time. It happens even setting the planet to kinematic and without moving.