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

Tracking Linear And Angular Player Velocity

61,741 Views

Report

  • using { /Fortnite.com/Devices }
    players_velocity_tracker_device := class<concrete>(creative_device):
        # Tracking variables
        var PlayersLastPositionAndRotation : [agent]tuple(vector3, rotation) = map{} 
        var PlayersVelocity : [agent]tuple(vector3, float) = map{}
        
        @editable
        DeltaTime : float = 0.0333 # 0.033 = 30 FPS, 0.016 = 60 FPS, 0.0083 = 120 fps ...
        @editable
        DebugUpdateTime : float = 0.0
        
        OnBegin<override>()<suspends>:void=
            spawn{UpdatePlayersVelocity()}
            if(DebugUpdateTime > 0.0):
                spawn{DebugOutput()}
    
        GetPlayerLinearVelocity<public>(Agent : agent)<decides><transacts>:vector3=
            var ReturnValue : ?vector3 = false
            if(PlayersVelocity[Agent], set ReturnValue = option{PlayersVelocity[Agent](https://dev.epicgames.com/community/snippets/GRVN/0)}):            
            ReturnValue?
        GetPlayerLinearVelocityLength<public>(Agent : agent)<decides><transacts>:float=
            var ReturnValue : ?float = false
            if(PlayersVelocity[Agent], set ReturnValue = option{PlayersVelocity[Agent](https://dev.epicgames.com/community/snippets/GRVN/0).Length()}):            
            ReturnValue?
        GetPlayerAngularVelocityRadians<public>(Agent : agent)<decides><transacts>:float=
            var ReturnValue : ?float = false
            if(PlayersVelocity[Agent], set ReturnValue = option{PlayersVelocity[Agent](https://dev.epicgames.com/community/snippets/GRVN/1)}):            
            ReturnValue?
        GetPlayerAngularVelocityDegree<public>(Agent : agent)<decides><transacts>:float=
            var ReturnValue : ?float = false
            if(VelocityInDegrees := GetPlayerAngularVelocityRadians[Agent] * 180.0 / PiFloat):        
                set ReturnValue = option{VelocityInDegrees}
            ReturnValue?
        UpdatePlayersVelocity<internal>()<suspends>:void=
            loop:
                for(i := 0..GetPlayspace().GetPlayers().Length-1, PlayerAgent := GetPlayspace().GetPlayers()[i]):
                    if(CFortChar := PlayerAgent.GetFortCharacter[], CFortChar.IsActive[]):
                        CurrentPositionCharacter := CFortChar.GetTransform().Translation
                        CurrentRotationCharacter := CFortChar.GetViewRotation()
                        if(LastPosition := PlayersLastPositionAndRotation[PlayerAgent](https://dev.epicgames.com/community/snippets/GRVN/0), LastRotation := PlayersLastPositionAndRotation[PlayerAgent](https://dev.epicgames.com/community/snippets/GRVN/1), cPlayerVelocity := ((CurrentPositionCharacter - LastPosition) / DeltaTime, (CurrentRotationCharacter.GetYawPitchRollDegrees()[0] - LastRotation.GetYawPitchRollDegrees()[0]) / DeltaTime), set PlayersLastPositionAndRotation[PlayerAgent] = (CurrentPositionCharacter, CurrentRotationCharacter)):
                            if(set PlayersVelocity[PlayerAgent] = cPlayerVelocity): # UEFN APIs will change in the future, so take in mind this is provvisory

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 Player · 7 of 26
Prev
fortnite number of players in team 1 2
Next
fortnite health regeneration grind rail

Source

Epic Games documentation

View original

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