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·24 of 26 in Player

Checking Player Gaze Direction

62,592 Views

Report

  • using { /Fortnite.com/Devices }
    using { /Verse.org/Native }
    using { /Verse.org/Simulation }
    using { /Verse.org/Random }
    using { /Verse.org }
    using { /UnrealEngine.com/Temporary/SpatialMath }
    using { /Verse.org/Simulation/Tags }
    using { /Fortnite.com/Game }
    using { /Fortnite.com/Characters }
    using { /UnrealEngine.com/Temporary/Diagnostics }
    
    building_manager_device := class(creative_device):
    
    IsLookingAtLocation(Character:fort_character, LocationToCheck: vector3, Threshold: float):logic=
             # Get the character's view location
            ViewLocation := Character.GetViewLocation()
             # Get the character's view rotation
            ViewRotation := Character.GetViewRotation()
            # Create a direction vector from the view location to the target vecto
            DirectionVector := Normalize(LocationToCheck - ViewLocation)
             # Convert the view rotation to a direction vector
            ViewDirection := ViewRotation.GetLocalForward()
            DrawDebugCone(Character.GetTransform().Translation, ViewDirection)
            DrawDebugLine(Character.GetTransform().Translation, Character.GetTransform().Translation + ViewDirection * 1000.0)
            # Compare the direction vector and the view direction
            # Use a dot product to find the cosine of the angle between the two vectors.
            # If it's close to 1, then the vectors are nearly parallel, so the character is looking at the target.
            CosAngle := DotProduct(ViewDirection, DirectionVector)
            if(IsFacing := CosAngle > Threshold):
                return true
            return false

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 · 24 of 26
Prev
fortnite polling player speed
Next
fortnite per player maximum hp shield manager

Source

Epic Games documentation

View original

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