using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is our main script. # It connects to the world and controls our devices. concert_manager := class(creative_device): # We need to find our devices. # Drag and drop your devices onto these properties # in the UEFN editor to connect them. @editable MySwitch : switch_device = switch_device{} @editable MyVideo : video_player_device = video_player_device{} # This function runs when the game starts. # It sets up the connections. OnBegin() : void = # We tell the switch to listen. # When a player turns it on, it calls 'PlayVideo'. MySwitch.TurnedOnEvent.Subscribe(OnSwitchActivated) # This function runs when the switch is flipped. OnSwitchActivated(Agent : agent) : void = # This line plays the video! # We use a special video ID. # note: SetVideoId is not available in the public Verse API; # the video URL/ID is configured in the video_player_device # editor properties. Calling Play() here starts the # video that was set up in the editor. MyVideo.Play() Print("Video is playing!")