Stage 2 · Lesson 6 of 8
Exposed variables and tuning
is found by tweaking numbers while the game runs: speed, jump height, cooldowns, damage. So do not hard-code them. Make them that show up in the editor, where you can change them without touching code.
In use [SerializeField] fields, in @export variables, and in Unreal UPROPERTY(EditAnywhere) or variables. Then you or a designer can tune the game freely, and different enemies can share one script with different values.
Group related values, and give them sensible defaults and ranges. Later stages depend on this, especially game feel and balancing.
Common trapchanging values in play mode, finding the perfect numbers, then losing them all when you stop the game, because play mode changes are not saved.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CourseFreeUnreal Engine Learning (Epic Developer Community)
Epic Games
Epic's free courses: Your First Hour and Your First Game teach the editor and Blueprints
- CourseFreeLearnCpp.com
LearnCpp.com · Beginner
Free, thorough modern C++, so Unreal C++ is only new macros, not a new language
Practise
Keep handy
Also worth your time
How Unreal C++ differs from standard C++ and how it fits with Blueprints
- Game Programming PatternsGo deeper
Free book on the state, observer, component and other patterns games rely on