---
tags:
    - "UI, User, Interface"
---

# Set Input Field Selection Anchor Position

[UI](../../index.md) / [Interaction](../index.md) / [Input Field](index.md) / **Set Input Field Selection Anchor Position**

## Description

Sets the Selection Anchor Position property of Input Field component

## Parameters

| Name | Description |
| :--- | :---------- |
| Input Field |  |
| Value |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;

namespace VisualScript.Runtime
{
    [Title("Set Input Field Selection Anchor Position")]
    [Category("UI/Interaction/Input Field/Selection Anchor Position")]
    [Description("Sets the Selection Anchor Position property of Input Field component")]
    
    [Image(typeof(IconUIInputField), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface")]
    
    [Parameter("Input Field")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenInstructionInteger_InputField_SetSelectionAnchorPosition : Instruction
    {
        [SerializeField] private GetGameObject m_InputField = new GetGameObject(
            new GenTypeGameObject_InputField()
        );
        
        [SerializeField] private GetInteger m_Value = new GetInteger();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Selection Anchor Position");
            return $"{this.m_InputField} {member} = {this.m_Value}";
        }
        
        protected override Awaitable Run(Args args)
        {
            InputField component = this.m_InputField.Get<InputField>(args);
            if (component == null) return Done;
            
            component.selectionAnchorPosition = (int) this.m_Value.Get(args);
            
            return Done;
        }
    }
}


```

