VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse UEFN›Verse Language·Up to UEFN · Verse Language·38 of 123 in Verse Language

Variable Initialization Practice

Lesson 3: Practice Time!

Lets say youre making a game with magic potions. Potions have different effects they can heal players or hurt them. You would want to declare and initialize some constants and variables to store player health, and the amount of damage or healing caused by a potion.

Let’s say you’re making a game with magic potions. Potions have different effects — they can heal players or hurt them. You would want to declare and initialize some constants and variables to store player health, and the amount of damage or healing caused by a potion.

Let’s say you’re making a game with magic potions. Potions have different effects — they can heal players or hurt them. You would want to declare and initialize some constants and variables to store player health, and the amount of damage or healing caused by a potion.

But which should be constants, and which should be variables?



|  | var PlayerHealth: float = 100.0 |
| --- | --- |
|  | PotionDamageAmount: float = 20.0 |
|  | PotionHealAmount: float = 10.0 |

Copy full snippet

The variables and constants you're changing here won’t affect your Fortnite character's health, but you will learn how to do exactly that in a later lesson!

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Verse Language · 38 of 123
Prev
learn code basics 2 practice time in verse
Next
learn code basics 3 storing and using information in verse
Browse all files in this folder (A–Z)

Source

Epic Games documentation

View original

Last updated 2024-12-05T00:00:00+00:00

VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse