Verse Library verse

01 Fragment

Activates when stepped on to alter a reference orb's material appearance.

verse-library/material-expressions/01-fragment.verse

# Import the core Verse libraries
using /Core.UnrealGaming

# Import the Verse API for interacting with game objects
using /Verse.Engine
using /FortniteGame

# This is our custom script attached to the Pressure Plate
actor class TrapScript extends Actor()
{
    # We need to reference the Orb that changes color
    # This is a "Variable" — a box where we store a reference to another object
    OrbProp: Prop
    
    # We need to reference the Material on the Orb
    # Think of this as holding the "Remote Control" for the orb's look
    OrbMaterial: Material

    # This function runs once when the island starts
    OnBegin<override>()<suspends>: void = 
    {
        # 1. Find the Orb. 
        # We assume the Orb is placed in the level and named "TheOrb"
        # If you haven't named it, find it by location or parent group.
        if (OrbActor := FindActorByClass<Prop>("TheOrb"))
        {
            OrbProp = OrbActor
            
            # 2. Get the Material from the Orb
            # Materials are attached to meshes. We grab the first one.

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