- Home /
Inaccurate collision detection (Bumps)
Hi, I've got a bunch of objects intersecting with eachother to form a ramp for another object to slide on (rigidbody). The problem is that when the sliding object hits some of those intersections (usually at high speed) it hits the edge/face of an object buried in another rather than the object above, causing the object to fly.
Take the image below for example - when the yellow object is dropped it ends up hitting the orange rectangle rather than the white one causing the yellow object to be thrown up in the air spinning.
Things I've tried:
Change collision detection to: Dynamic
Change interpolate to: Interpolate and Extrapolate
Reduce the rigidbody's contactOffset
Increase PhysicsManager/Default Solver Iterations
Increase PhysicsManager/Default Solver Velocity Iterations
Reduce TimeManager/Fixed Timestep (makes it slightly better but at the cost of performance)
Any ideas on how to tackle this problem would be greatly appreciated. Thanks.
Answer by TheGDX · Dec 04, 2018 at 05:25 PM
Physx 3.4 fixes this issue! (Available with Unity 2018.3)
Answer by hexagonius · Dec 04, 2018 at 07:31 AM
the physics engine does not know anything about above or below or stuck into each other. it just does overlap checking and resolved those.
the optimal solution would be modelling the whole ramp as one and use it as MeshCollider. the other would be stretching those cubes way longer so their edges are way it of reach. to compensate for the visuals you could have the colliders repeated from the renderers so they still look fine while collision is handled with longer blocks.
The single mesh solution would indeed be the optimal solution however, I'm interested in keeping things modular (which I forgot to mention) - the idea is to be able to create paths (ramps) using blocks. Thanks for the help nonetheless.
Your answer
Follow this Question
Related Questions
Punching a crate 0 Answers
Camera gets flung off of the map when the player collides with certain objects. 0 Answers
Exported Scene in .swf loses 2D colliders ? 1 Answer
Collision detection for many colliders 0 Answers
Getting "Internal error: Too many pairs created" without any apparent reason 0 Answers