# This is our main script file. # It defines a component for our platform. using { /Fortnite.com/Devices } using { /Verse.org/Sim } # We create a new type called MovingPlatform. # This is our "Component" definition. MovingPlatform := class(Component): # This is the speed of movement. # It is a constant value. MovementSpeed := 100.0 # This function runs every frame. # It updates the platform's position. OnUpdate := func(event: UpdateEvent): # Get the current position of the entity. current_pos := GetTransform().Location # Calculate the new position. # We move it up or down based on time. new_y := current_pos.Y + (MovementSpeed * event.DeltaTime) # Create the new transform. new_transform := Transform{ Location: Vector{ X: current_pos.X, Y: new_y, Z: current_pos.Z }, Rotation: GetTransform().Rotation } # Apply the new transform. SetTransform(new_transform)