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

# Set Game Object

[Set](index.md) / **Set Game Object**

## Description

Sets a Game Object value

## Parameters

| Name | Description |
| :--- | :---------- |
| Set | Where the value is stored |
| Value | The value to store |

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Set Game Object")]
    [Image(typeof(IconCubeOutline), ColorTheme.Type.Blue)]
    
    [Description("Sets a Game Object value")]
    [Category("Set/Set Game Object")]
    
    [Parameter("Set", "Where the value is stored")]
    [Parameter("Value", "The value to store")]
    
    [Keywords("Set", "Change", "Modify", "Assign")]
    [Keywords("Object", "Prefab", "Instance", "Unity")]
    
    [Serializable]
    public class InstructionCoreSetGameObject : Instruction
    {
        [SerializeField] private SetGameObject m_Set = new SetGameObject();
        [SerializeField] private GetGameObject m_Value = new GetGameObject();

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

        protected override Awaitable Run(Args args)
        {
            GameObject value = this.m_Value.Get(args);
            this.m_Set.Set(value, args);
            
            return Done;
        }
    }
}
```

