Hello, I’m making a clone of Arkanoid/Brick Breaker and I want the ball to bounce in a particular direction depending on how close is to the right or left border of the paddle.
I thought that, in order to do so, I need the impact point of the ball ON the GameObject paddle, I have tried this:
function OnCollisionEnter2D (collision : Collision2D) {
if (collision.gameObject.tag == "Ball" ) {
var contact : Vector2;
contact = collision.contacts[0].point;
Debug.Log(contact);
}
}
But what I am getting is the impact point on the ENTIRE scene not on the GameObject paddle. What solution do you suggest? Thanks in advance.