Verse Library verse

01 Fragment

Activates a map controller device to enable visibility and configure zoom levels for the player mini-map.

verse-library/making-a-custom-mini-map-in-unreal-editor-for-fortnite/01-fragment.verse

# This is a simple comment explaining the code.
# We are creating a function to handle the map.
OnBegin<override>()<suspends>: void =
    # This line starts the map controller.
    # It tells the device to wake up.
    # note: map_controller must be declared as a @editable property
    # on your creative_device class and wired to the Map Controller
    # device in the UEFN Details panel before running this code.
    map_controller.Enable()

    # This line sets the zoom level.
    # 1.0 is normal. 2.0 is zoomed in.
    # note: ZoomScale is a float property set in the Details panel;
    # map_controller_device exposes no runtime SetZoom API, so we
    # activate the device and rely on the pre-configured zoom value.
    map_controller.Activate(GetPlayspace().GetPlayers()[0])

    # This line makes the map visible.
    # Enabling the device causes the mini-map to appear for all players.
    map_controller.Enable()

Comments

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