Skip to lesson
LESSON 10 / 44 · Beginner

Walking and running

Give the player two movement speeds with the existing player-action settings.

Open editor in a new tab ↗

Before you begin

Select a player on a solid floor.

Build it step by step

  1. In Object details choose Enable player actions. This connects keyboard movement, gravity and the supported action controls.

  2. Set Walking speed to 140 and Running speed to 260 as starting values. These numbers are examples, not required defaults.

  3. Expand Choose input actions and inspect the Run action. Open Game → Game controls and bind that action to Shift if desired.

  4. Press Play, hold a direction and compare travelling with and without Run held. The player should move faster while running.

  5. Return to the editor and tune the two speeds so the player can stop and land comfortably. Keep jump speed unchanged while comparing horizontal speed.

TRY THIS IDEA

Practical example

A short corridor is easier to test than a full level. Time how long walking and running take to cross it.

Test your work

Walking and running are distinct, while both use the same collision system and directional controls.

If it does not work

If there is no difference, check Use player actions and the selected Run action. Do not add a rule that replaces keyboard movement with a fixed velocity.

MAKE IT YOUR OWN

Student challenge

Create one safe walking route and one faster running route.

Show the result to a partner. Explain what you changed and how you tested it.

Keep exploring