Minus paddle

Hi from the island of Malta!

What a fantastic course!
I have my first question. I couldn’t understand why we are subtracting paddle position from ball position. As below.

 paddleToBallVector = transform.position - paddle1.transform.position;

As I understand:
If paddle is on 5,0 and ball is at 5,1. For me that means 0,1.

What am I missing? :slight_smile:

GOT IT :slight_smile:

Hi Anthony,

What was the solution?


See also:

We subtracted paddle position from ball position to get the difference value.
We later added paddleToBallVector (the difference) to the current paddlePos.
paddlePos has a dynamic value. Allowing it to update position.

Quite straight forward. But my mind did not click :slight_smile:

Sometimes our brains need a bit longer, funnily, often for rather simple ideas. Maybe it’s because we often expect difficult solutions for difficult(?) problems.

So true!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms