Verse Library verse

16 Note To See This In Game Verse Debug Draw Must Be

Renders a debug arrow visualizing an NPC current target direction for testing.

extracted-snippets/documentation/en-us/uefn/create-custom-npc-behavior-in-unreal-editor-for-fortnite/16-note-to-see-this-in-game-verse-debug-draw-must-be-.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/create-custom-npc-behavior-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/uefn/create-custom-npc-behavior-in-unreal-editor-for-fortnite.md
# Section:    NOTE: To see this in game, Verse Debug Draw must be enabled in Island Settings.
# This function draws an arrow from the Agent's head to its look at point every half a second.
# NOTE: To see this in game, Verse Debug Draw must be enabled in Island Settings.
DrawDebugLookAt(Character:fort_character, LookAtPoint:vector3)<suspends>:void=
    loop:
        DebugDrawNPC.DrawArrow( Character.GetTransform().Translation + vector3{ Z := VerticalOffsetToNPCHead},
                                LookAtPoint,
                                ?ArrowSize := 50.0,
                                ?Color := NamedColors.Yellow,
                                ?Thickness := 5.0,
                                ?DrawDurationPolicy := debug_draw_duration_policy.FiniteDuration,
                                ?Duration := LookAtDebugDrawDuration )

        #This sleep matches the length of time the arrow is drawn to avoid duplicate draws.
        Sleep(LookAtDebugDrawDuration)

Comments

    Sign in to vote, comment, or suggest an edit. Sign in