Why didn't the Paddle animate before?

When we wrote the line transform.x = 2, the Paddle just jumped into position; it didn't go anywhere, like it does now. Why is that?

The Update function is still getting called multiple times. But each time, it's putting the Paddle at two units on the X-axis. The value of x changes on every Update, but it changes to the same thing. So, once Paddle is in position, it doesn't appear to move.

With our new modified line of code, the x position of the Paddle is changing by 0.2 every time the Update function is called, so Paddle moves across the screen.

An important part of being a beginner programmer is keeping a positive attitude. You should start with the assumption that what you want to do can be done—anything is ...

Get Unity 4.x Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.