Hi Everyone,
How to solve this problem has been driving me crazy for weeks now. Try this:
- Create a new scene
- Add 8 x planes (or cubes) and align them perfectly in a line
- Add a sphere, and place it at the far end plane
- Add the trail renderer component to the sphere, a rigidbody (add some drag), and a very quick script to addforce along the ‘floor’ (enough force that it should at the very least reach the end)
- The sphere will catch on the seams between the planes causing it to bounce, instead of rolling perfectly along the ‘floor’
How to people work around this?
Things I’ve experimented with no success:
Physics:
- Sleep Threshold
- Default Contact Offset
- Solver Iterations
- Gravity
- All matter of physics materials
Rigidbody:
- Everything in the panel
- Max Angular Velocity
Colliders:
- Various types of colliders
- Overlapping colliders
Things I’m considering but not sure how:
- Runtime merge of mesh? (as ‘real’ use scenario would not just be a simple row of planes)
- Raycast in front of the sphere and make some sort of adjustment?
- OnCollisionEnter to detect the seam, and some sort of adjustment that way?
Obvious Answers:
-
Create one single mesh and import it into Unity. Yes that is do-able, however, in the long term it would be preferable to be able to use modular parts
-
Constraining the sphere on the Z axis is also possible. However, if you then tackle the same problem with the planes at an angle, we’re back to square one,
Any help would be appreciated.