# This is our main script file. using { /Fortnite.com/Devices } using { /Fortnite.com/Characters } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is our custom script. # It controls the camera behavior. MyCameraScript := class(creative_device): # We need a camera device. # This is the "eye" of our scene. # Link this to your Fixed Point Camera device in the editor. @editable Camera : gameplay_camera_fixed_point_device = gameplay_camera_fixed_point_device{} # We need a trigger device. # The player steps on this to start the scene. # Link this to your Button/Trigger device in the editor. @editable ArrivalTrigger : trigger_device = trigger_device{} # This function starts when the island loads. # It sets up our scene. OnBegin() : void = # Make sure the camera is hidden at first. # We do not want it active yet. Camera.RemoveFromAll() # Wait for a player to step on the trigger. # TriggeredEvent fires when any agent activates the trigger. Agent := ArrivalTrigger.TriggeredEvent.Await() # Run the arrival logic for that player. if (ValidAgent : agent = Agent?): OnPlayerArrived(ValidAgent) # This function runs when the player steps on a trigger. # We will connect this to a button later. OnPlayerArrived(Agent : agent) : void = # Turn the camera ON so the player sees the fixed view. Camera.AddTo(Agent) # Tell the camera to focus on the player. # This makes the camera pivot toward the agent. # note: gameplay_camera_fixed_point_device.AddTo(agent) already # points the camera at that agent as its subject. # Wait for 5 seconds. # This gives the player time to pose. Sleep(5.0) # Turn the camera OFF. # The player can move freely again. Camera.RemoveFrom(Agent)