Quick Win 2: Turn a moving object into a player you can control
If you are here, you already crossed an important line.
You made something move in Unity.
Now we are going to make that movement respond to you. Not a full character controller. Not animations. Just clean input driving motion.
What you are building
By the end of this quick win, your object will move when you press input on your keyboard or controller using Unityβs Input System.
- A controllable player object
- Movement driven by a Move action
- A simple pattern you can reuse in any project
Important note for Unity 6 users
Unity 6 comes with a ready to use Input Actions asset named InputSystem_Actions. It should already be in your project automatically, so you do not need to create one from scratch.
If you do not see it, make sure the Input System package is installed and your project is set to use it.
Step 1: Add a PlayerInput component
Select your moving object and add a PlayerInput component. In the PlayerInput component, set the Actions field to InputSystem_Actions.
This gives your object access to the default actions without you hunting through files.
Step 2: Add this script to your object
Create a script named PlayerMovement and paste this in. This script grabs the Move action by name and reads its value each frame. Make sure to add this new component to your object in the Inspector.
Unity version note
This example is intended for Unity 6 and newer. Unity 6 includes a default Input Actions asset named InputSystem_Actions, which is automatically loaded by the Input System. You do not need to manually locate or assign an input actions file.
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerMovement : MonoBehaviour
{
public float speed = 5f;
private InputAction moveAction;
private void Start()
{
moveAction = InputSystem.actions.FindAction("Move");
moveAction.Enable();
}
private void Update()
{
Vector2 input = moveAction.ReadValue();
Vector3 movement = new Vector3(input.x, 0f, input.y);
transform.Translate(movement * speed * Time.deltaTime, Space.World);
}
}
Step 3: Adjust your camera
Select your main camera and adjust its position and rotation to the following:
Step 4: Press play and test
Press Play and move with WASD or your controller stick. If your object responds, you just built a real controllable player using modern Unity input.
This is a big step. You are not just making objects move. You are building interaction.
If it did not work
Here are the checks that fix almost everything:
- Confirm your project is using the Input System.
- Confirm the Move action exists and is named correctly.
The default action name is usually Move. - Confirm your script is on the same object you want to move.
Select the object and make sure PlayerMovement is added in the Inspector. - Confirm there are no console errors.
If you see an error related to actions, it points to the exact missing or mismatched name.
Quick debug note
If FindAction throws an error, the action name does not match. Double-check the action name is exactly Move.
What you just unlocked
You now understand a clean modern pattern: an action provides a value, and that value drives behavior.