Learn › Godot 3D Advanced

Lesson 4 of 5 · About 6 min

Speed and stamina

How Sunny Valley lets the hero sprint without breaking the day's challenge: a speed, a multiplier and a stamina bar. Then a faster, longer sprint.

Walking and sprinting

The hero walks at SPEED, 5.5 metres a second. Holding B sprints at SPRINT_MUL times that, 1.7, about 9.4 metres a second, but a stamina bar runs down while you sprint and fills up again when you stop.

The bar is what keeps the day fair: without it, sprinting everywhere would make the clock meaningless.

Godot 3D Advanced is a course for paid accounts. The rest of this lesson, and its guided session, are in the app.

Start makingDownload on the App StoreGet it on Google Play