Snippet
Snippet

Reputation: 1560

Unity Sprites - Collider not working Properly

I was following a tutorial on how to create a simple game called pong. As I was working on it. I stumbled on a bug that when the ball is to fast it will it passes through the paddle without colliding with the collider

As you can see in the screenshot

enter image description here

Is this some kind of a bug in unity? I need to get rid of this and don't want to have this in my game.

by the way this was the tutorial I was following . Brackeys

Upvotes: 2

Views: 1720

Answers (1)

Veselin Romić
Veselin Romić

Reputation: 700

What do you mean by 'bypass the player control'? Do you mean it passes through the paddle without colliding with the collider, even though it should? Or does it get stuck? The screenshot makes it difficult to tell.

Either way, the first thing you're going to want to try is changing the collision detection setting of your Rigidbody2D component from 'Discrete' (the default value) to 'Continuous' or 'Continuous Dynamic'. Fixing this sort of issue (collision errors for fast-moving objects) is exactly what those options are for.

Source: http://docs.unity3d.com/Manual/class-Rigidbody.html

Upvotes: 1

Related Questions