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

How Input, Parameters, and Arguments Work in Verse

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

GetNumberOfMousetrapsYouCanAfford() : int

Copy full snippet(1 line long)

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 |

name(parameter : type) : type = codeblock

Copy full snippet(2 lines long)

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 · 2 of 31
Prev
basic storm controller
Next
basics of writing code 9 failure and control flow in verse
Browse all files in this folder (A–Z)

Source

Epic Games documentation

View original

Last updated 2026-03-29T10:07:18.252594+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