Launch The Ball (Complete Unity Game Developer 2D)

Hi Veen,

Welcome to our community! :slight_smile:

Before I start explaining anything: Does your code work? If not, make sure the method names are spelt correctly. In the code you posted, the Update method must be called “Update” with a capital U.

Furthermore, the condition of the if-statement in the Update method must be (hasStarted != true); alternatively, (!hasStarted).

Our Update method gets called each frame. This means that the if-condition gets evaluated each frame, too. As long as the result is “false”, the if-block gets executed, and therefore also the LaunchOnMouseClick code block. And that’s how the ball gets locked to the paddle.


See also: