Verse Library verse

01 Device

Creates a jump pad that launches vehicles upward when a player drives over a trigger zone.

verse-library/construct-a-vehicle-jump/01-device.verse

# 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<override>()<suspends>: void=
        # Connect the trigger to our jump function.
        # When the trigger fires, run JumpVehicle.
        Trigger.TriggeredEvent.Subscribe(OnTriggered)

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