---
tags:
    - "UI, Layout"
---

# Rect Transform Set Local Right

[UI](../../index.md) / [Layout](../index.md) / [Rect Transform](index.md) / **Rect Transform Set Local Right**

## Description

Executes the Set Local Right method on the Rect Transform component

## Parameters

| Name | Description |
| :--- | :---------- |
| Value |  |
| Preserve Size |  |

## 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("Rect Transform Set Local Right")]
    [Category("UI/Layout/Rect Transform/Set Local Right")]
    [Description("Executes the Set Local Right method on the Rect Transform component")]

    [Image(typeof(IconRectTransform), ColorTheme.Type.TextLight)]
    [Keywords("UI, Layout")]

    [Parameter("Value")]
    [Parameter("Preserve Size")]

    [Serializable]
    public class GenInstructionRectTransform_SetLocalRight_2 : Instruction
    {
        [SerializeField] private GetGameObject m_RectTransform = new GetGameObject(
            new GenTypeGameObject_RectTransform()
        );

        [SerializeField] private GetNumber m_Value = new GetNumber();

        [SerializeField] private GetBool m_PreserveSize = new GetBool();

        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Local Right");
            return $"{this.m_RectTransform} {method} ({this.m_Value}, {this.m_PreserveSize})";
        }

        protected override Awaitable Run(Args args)
        {
            RectTransform component = this.m_RectTransform.Get<RectTransform>(args);
            if (component == null) return Done;

            component.SetLocalRight(
                (float) this.m_Value.Get(args),
                (bool) this.m_PreserveSize.Get(args)
            );

            return Done;
        }
    }
}
```

