- Home /
Is my missed collision too fast or too thin?
I'm using Unity 4.6.3f1 (free).
I have created a test project where the collision detection regularly allows two objects to pass through each other. At first glance, it's not entirely obvious why this would be. This video shows the objects moving toward each other at a relatively sedate pace; the "ball" bounces off the first "paddle", but misses the second.
Other postings here have suggested using Continuous Dynamic collision detection. I found that it affected the outcome (as shown in the video), but didn't actually solve the problem. Other posts have referenced a "DontGoThroughThings" script, but the link to that script in the postings I've found is dead.
My understanding is that this is all going horribly wrong because the objects are moving too quickly -- the objects are large and are actually moving at 200 units/second. However, it's not that simple: if I increase the Z-scale (thickness) of the "ball" from 2.5 to 4, the collisions work reliably, even with "discrete" collisions.
So my question is: is this a problem with things being too fast? The colliders cover a large area, so it's not possible to entirely miss the collision. Are the shapes too thin to register a collision, which is why increasing the thickness helps? That doesn't make sense to me either, since it's just trivial box colliders, unless something is getting rounded off badly.
(Note: for this specific situation the best answer is to rotate the scene 90 degrees and switch to 2D bodies and colliders. In addition to getting correct handling of the collisions, the "ball" doesn't lose momentum when it collides at a corner of a "paddle", which seems to happen even with bounciness set to 1 on all elements.)