VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Community Snippets›Devices·Up to Community Snippets · Devices·24 of 70 in Devices

Custom HUD Message Widget With Timer

23,759 Views

Report

  • 
    using { /Fortnite.com/Devices }
    using { /Verse.org/Simulation }
    using { /UnrealEngine.com/Temporary/Diagnostics }
    
    # The timer code
    custom_timer_device := class(creative_device):
    
        @editable
        HUDDevice : hud_message_device = hud_message_device{}
    
        # You can set the maximum time for the timer here. 0 = no max time
        @editable
        MaxTimeInSeconds : int = 60
    
        # Runs when the device is started in a running game
        OnBegin<override>()<suspends>:void=
    
            StartTimer()
    
        StartTimer()<suspends>:void=
            # This timer uses seconds and will convert the seconds into minutes as it counts upwards
            #Create a variable to track how many seconds we've counted. We'll reset this one to 0 each time it reaches 60
            var Seconds : int = 0
            # Create a variable to track the total seconds passed. This will not reset and will be used to break out of timer loop
            var TotalSeconds : int = 0
            #Create a variable to track how many minutes we've counted
            var Minutes : int = 0
            #Start timer loop
            loop: 
                # 1 time per second
                Sleep(1.0)
                #Increase the second counter
                set Seconds += 1
                set TotalSeconds +=1
                #If seconds is more than 59            
                if(Seconds > 59):
                        #increase minute counter
                        set Minutes +=1 
                        # reset second counter
                        set Seconds = 0
                #Create a Hud message string to update our HUD with, and set the message to the result of this if statement
                HudMessage : string = 
                    if (Seconds < 10):
                        "{Minutes}:0{Seconds}" 
                    else :
                        "{Minutes}:{Seconds}"
                # Set the Hud message at the end of every loop (1x per second)
                HUDDevice.SetText(StringToMessage(HudMessage))
                HUDDevice.Show()
                if(TotalSeconds >= MaxTimeInSeconds, MaxTimeInSeconds > 0):
                    Print("Max Timer time reached!")
                    break

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 Devices · 24 of 70
Prev
fortnite double pump verse device
Next
fortnite trigger a barrier with a time limit

Source

Epic Games documentation

View original

Last updated 2026-07-26T12:17:24.596808+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