Unity Learn home
View Tutorial Content

Read keyboard input to control 2D character movement

Tutorial
Beginner
+10 XP
40 Mins
(3066)
Summary
The player character can move, but at the moment it does so whenever you test the game. Now you need to configure it to move only when the player provides specific input.
By the end of this tutorial, you’ll be able to do the following:
  • Read the current state of a player input device (keyboard).
  • Apply horizontal and vertical movement to a GameObject in response to keyboard input.
Select your Unity version
Last updated: November 14, 2024
2022.3
Language
English
Read keyboard input to control 2D character movement