Unity - collision failure for fast moving objects

2.2k views Asked by At

Does anyone have any suggestions on how to deal with fast moving objects missing collisions in Unity. I am creating a breakout game for mobile and discovered that when the paddle is moved very fast then it misses the collision with the ball. I changed the collision to continuous detection but that throws up weird behaviour such as paddle being pushed down on collision.

I also tried playing around with the dontgothrough script to make it work for 2D colliders without success. Anyone have any suggestions?

1

There are 1 answers

1
Alexander Hoischen On

Collision with fast moving objects is a problem in many game engines. There are a few ways of dealing with it:

  1. Make the objects slower.
  2. Make the objects bigger.
  3. Update collision on intermediate steps.
  4. Calculate the objects path and try to find any points where it collides with other objects.

I would suggest you either stop the paddle from going too fast, by enforcing a speed limit. Make the paddle follow the user's finger, but not snap to it instantly. This would probably look better as well.

You could also widen the paddle, but that might affect the game's balance a bit too much.