I was working on a Block Breaker style game and I want to have an object, that when struck by the ball, would shoot the ball back directly at the paddle.
I’ve been trying different way of going about it, but each time the ball seems to bounce away from the paddle instead of towards it. This is my ‘grab and follow back’ code right now in the Ball’s Update() method:
else if (seekingPaddle)
{
var vector = Vector2.MoveTowards (gameObject.transform.position, paddle.transform.position, 256 * Time.deltaTime);
GetComponent<Rigidbody2D>().velocity = vector;
}
Any ideas what I’m doing wrong here? I’ve noticed the ball always bounces away to the right, if that helps.