Want 2d Ball to bounce towards paddle, but it shoots away instead

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.

You are adding an extra step you don’t need. Vector2.MoveTowards is supplying the object with the velocity it needs, so you don’t need to do your GetComponent().velocity = vector; line at all.

Your code just needs to be:

 else if (seekingPaddle) 
 {
         gameObject.transform.position = Vector2.MoveTowards (gameObject.transform.position, paddle.transform.position, 256 * Time.deltaTime);
         
 }

I don’t know if your speed will now need to be tweaked or not. That looks pretty fast, so if it zips over there on your first try, reduce 256 to something smaller.