Verse Library verse

03 Into The Hangar

Rotates a prop to track the player after a delay, playing an audio cue for dramatic effect.

extracted-snippets/documentation/en-us/uefn/lego-scary-space-in-unreal-editor-for-fortnite/03-into-the-hangar.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/lego-scary-space-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/uefn/lego-scary-space-in-unreal-editor-for-fortnite.md
# Section:    Into the Hangar
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { Utility }
prop_look_at_device := class(creative_device):
# The editable attribute creates a reference which is assignable in the editor
# The eye-flower prop that we are rotating
@editable
Prop : creative_prop = creative_prop{}
@editable
PlayerTrigger : trigger_device = trigger_device{}
@editable
CreakAudioPlayer : audio_player_device = audio_player_device{}
DetectionThreshold : float = 800.0
RotationInterval : float = 0.5
OnBegin<override>()<suspends> : void =
# Wait for the player to enter the room and trigger the PlayerTrigger
PlayerTrigger.TriggeredEvent.Await()
# The PlayerTrigger also engages the lights which are turned on with a delay. See "StorageRoom Light Sequence Billboard" in the editor for more information.
# Therefore we wait 3 seconds until the lights are on before the plant rotates. This is for dramatic effect.
Sleep(3.0)
# Here we start the update coroutine checking the player position and rotating the prop towards them.
UpdateProp()
UpdateProp()<suspends>:void=
# To begin with the eye-flower prop does a dramatic 180 degree turn and plays an audio cue,

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

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