---
tags:
    - "Set"
    - "Change"
    - "Modify"
    - "Assign"
---

# Set Vector2

[Set](index.md) / **Set Vector2**

## Description

Sets a Vector2 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 Vector2")]
    [Image(typeof(IconVector2), ColorTheme.Type.Lime)]
    
    [Description("Sets a Vector2 value")]
    [Category("Set/Set Vector2")]
    
    [Parameter("Set", "Where the value is stored")]
    [Parameter("Value", "The value to store")]
    
    [Keywords("Set", "Change", "Modify", "Assign")]
    
    [Serializable]
    public class InstructionCoreSetVector2 : Instruction
    {
        [SerializeField] private SetVector2 m_Set = new SetVector2();
        [SerializeField] private GetVector2 m_Value = new GetVector2();

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

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

