# This script makes vehicles jump when they hit a trigger. using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/SpatialMath } # This is our main device. It holds the trigger and the logic. JumpPadDevice := class(creative_device): # This is the Trigger Zone device. # It detects when a vehicle enters the area. # Wire this to a trigger_device in the UEFN editor. @editable Trigger: trigger_device = trigger_device{} # This is the Air Vent device that delivers the upward push. # Wire this to an air_vent_device placed under the jump pad. # note: air_vent_device is the real API for the Air Vent creative device. @editable AirVent: air_vent_device = air_vent_device{} # This is the Force we apply to the jump. # 5000 is a strong push. Try changing this number! # This is a Constant for the jump height. JumpForce: float = 5000.0 # This function runs when the game starts. OnBegin(): void= # Connect the trigger to our jump function. # When the trigger fires, run JumpVehicle. Trigger.TriggeredEvent.Subscribe(OnTriggered) # This function is called when the trigger fires. # agent? is the optional agent (player) who activated the trigger. OnTriggered(Agent: ?agent): void = # Enable the Air Vent to launch whatever is above it. # note: Verse has no direct fort_vehicle.ApplyForce API; the # air_vent_device is the supported way to launch vehicles in UEFN. AirVent.Enable() # Check the triggering agent to confirm something valid entered. # If a player drove the vehicle onto the pad, Agent will be set. if (A := Agent?): # The player (and their vehicle) is on the pad. # The Air Vent handles the upward force automatically. # We print a debug message so you can see it working. Print("Jump pad triggered! Launching vehicle.") else: # No agent — something else activated the pad. Print("Jump pad triggered by a non-agent object.")