VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse UEFN›Input & Controls·Up to UEFN · Input & Controls·5 of 13 in Input & Controls

Lesson 8: Input, Parameters, and Arguments

Lesson 8: How Input, Parameters, and Arguments Work

Input is information added to a program and used by code to make changes.

Input is information added to a program and used by code to make changes.

The function examples given in the previous lesson didn’t need any input:

GetNumberOfMousetrapsYouCanAfford() : int
Copy full snippet

You know this because the parentheses () in the function signature above are empty.

Parameters

You can define the input a function needs by adding a parameter to the function signature.

A parameter is a constant that’s declared in the function signature between the parentheses. When a parameter is set, you can use it in the body of the function.

The syntax for a function that includes a parameter looks like this:



|  | name(parameter : type) : type = |
| --- | --- |
|  | codeblock |

Copy full snippet

In the following example, CoinsPerMousetrap is now a parameter for the function BuyMousetrap():



|  | var Coins : int = 500 |
| --- | --- |
|  |  |
|  | BuyMousetrap(CoinsPerMousetrap : int) : void = |
|  | set Coins = Coins - CoinsPerMousetrap |
|  | Print("Mousetrap bought! You have {Coins} coins left.") |

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 Input & Controls · 5 of 13
Prev
keyboard shortcuts in unreal editor for fortnite
Next
uefn controls for creative users in unreal editor for fortnite
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