Verse Library verse

01 Fragment

Activates a trigger volume to toggle volumetric cloud density, switching between clear skies and storms.

verse-library/volumetric-cloud-component/01-fragment.verse

# WeatherController.ver
# This script controls the cloud density based on player input.

using { /Fortnite.com/Devices }
using { /Verse.org/Sim }
using { /UnrealEngine.com/Temporary/Sim }

# 1. Define the Script Structure
# This is like the "Blueprint" for our device. It holds references to other things.
simb WeatherController : IScriptable =
    # This is a "Device" reference. Think of it as a remote control.
    # We'll connect this to a Trigger Volume in the editor.
    TriggerDevice: Device = Device{}
    
    # This is a "Component" reference.
    # We'll connect this to our Volumetric Cloud component.
    CloudComponent: Component = Component{}
    
    # This is a "Constant" (a value that never changes).
    # High density means thick, stormy clouds.
    const STORM_DENSITY: float = 0.8
    # Low density means clear skies.
    const CLEAR_DENSITY: float = 0.1
    
    # This is a "Variable" (a value that can change).
    # We'll use this to track if it's currently storming.
    var is_storming: bool = false

    # 2. The Main Event Loop
    # This function runs once when the game starts.

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