Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Set Game Objects#

Set / Set Game Objects

Description#

Sets a collection of Game Object values

Parameters#

Name Description
Set Where the collection is stored
Value The collection of game objects to store

Code#

using System;
using System.Collections.Generic;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Set Game Objects")]
    [Image(typeof(IconCubeOutline), ColorTheme.Type.Blue, typeof(BadgeList))]
    
    [Description("Sets a collection of Game Object values")]
    [Category("Set/Set Game Objects")]
    
    [Parameter("Set", "Where the collection is stored")]
    [Parameter("Value", "The collection of game objects to store")]
    
    [Keywords("Set", "Change", "Modify", "Assign")]
    [Keywords("Object", "Prefab", "Instance", "Unity", "Group", "Collect", "Gather")]
    
    [Serializable]
    public class InstructionCoreSetCollectionGameObjects : Instruction
    {
        [SerializeField] private SetCollectionGameObjects m_Set = new SetCollectionGameObjects();
        [SerializeField] private GetCollectionGameObjects m_Value = new GetCollectionGameObjects();

        protected override string GetTitle(GameObject source) => $"{this.m_Set} = {this.m_Value}";

        protected override Awaitable Run(Args args)
        {
            List<GameObject> value = this.m_Value.Get(args);
            this.m_Set.Set(value, args);
            
            return Done;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.