Keep the Paddle On Screen

W and S drive the left paddle now, and it has one problem. Hold W for two seconds and it keeps going, straight past the top wall and out of the camera's view. Nothing in the code tells it where the playfield ends. This node adds that limit, in three lines.

More in Set Up the Input System

  1. Read the Keyboard
    1. Ask a Question With if
  2. Move a Paddle
    1. Keep the Paddle On Screen
  3. Add the Second Paddle

All 54 topics in the Your First Unity Game