---
tags:
    - "Set"
    - "Change"
    - "Modify"
    - "Assign"
    - "Object"
    - "Prefab"
    - "Instance"
    - "Unity"
    - "Group"
    - "Collect"
    - "Gather"
---

# Set Game Objects

[Set](index.md) / **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

```cs
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;
        }
    }
}
```

