Verse Library verse

01 Fragment

Device that modifies landscape material blend factors when players enter a trigger zone.

verse-library/landscape-material-layer-blending/01-fragment.verse

using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/Symbols }

# We are creating a device that changes the landscape material's "Blend Factor"
# when a player enters a trigger. Think of it like a storm circle that changes the terrain type.

class MudSlideDevice is Device()
    # The trigger zone - like a kill box but for mud
    MudTrigger: Trigger = Trigger()
    
    # The landscape material we want to modify
    # We need to expose this so we can change its parameters
    MudMaterial: Material = Material()
    
    # A parameter in the material named "MudIntensity" (0.0 to 1.0)
    # 0.0 = Pure Grass
    # 1.0 = Pure Mud
    MudIntensityParam: string = "MudIntensity"

    OnBegin<override>()<suspends>: void =
        # Listen for players entering the trigger
        MudTrigger.OnBeginOverlap.Subscribe(OnPlayerEnter)

    OnPlayerEnter(overlap_event: TriggerBeginOverlapEvent)<suspends>: void =
        # Get the player who entered
        player := overlap_event.Actor.GetPlayer()
        
        if (player != null):
            # "Activate" the mud slide
            # This is a simplified example. In reality, you'd usually

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