Verse Library verse

02 Standalone

Creates a platform component that rises and slides smoothly, carrying players standing on it.

verse-library/verse-anim-moving-platform/02-standalone.verse

using { /Verse.org/SceneGraph }
using { /Verse.org/SceneGraph/KeyframedMovement }
using { /Verse.org/Simulation }
using { /Verse.org/SpatialMath }

# THE CAPSTONE: a moving platform the player can ride.
#
# Bolt this onto a platform entity (a floor mesh) that also has a Keyframed
# Movement component. Because the mover animates the entity in the pre-physics
# phase, a player standing on the surface is carried along — so animating the
# floor IS building a rideable elevator.
riding_platform_component := class<final_super>(component):

    # How high the platform climbs, in units.
    @editable
    var RiseHeight<public>:float = 400.0

    # How far it slides sideways at the top, in units.
    @editable
    var SlideDistance<public>:float = 500.0

    # Seconds for each moving leg.
    @editable
    var LegSeconds<public>:float = 3.0

    # Seconds to pause at each end (a still keyframe = a hold).
    @editable
    var HoldSeconds<public>:float = 1.0

    OnBeginSimulation<override>():void =

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