---
tags:
    - "Socket, Ancestor, Keep, Track, Follow"
---

# Parent Constraint Set Translation Offset

[Animation](../../index.md) / [Constraints](../index.md) / [Parent Constraint](index.md) / **Parent Constraint Set Translation Offset**

## Description

Executes the Set Translation Offset method on the Parent Constraint component

## Parameters

| Name | Description |
| :--- | :---------- |
| Index |  |
| 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.Animations;

namespace VisualScript.Runtime
{
    [Title("Parent Constraint Set Translation Offset")]
    [Category("Animation/Constraints/Parent Constraint/Set Translation Offset")]
    [Description("Executes the Set Translation Offset method on the Parent Constraint component")]
    
    [Image(typeof(IconHanger), ColorTheme.Type.Pink)]
    [Keywords("Socket, Ancestor, Keep, Track, Follow")]
    
    [Parameter("Index")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenInstructionParentConstraint_SetTranslationOffset_2 : Instruction
    {
        [SerializeField] private GetGameObject m_ParentConstraint = new GetGameObject(
            new GenTypeGameObject_ParentConstraint()
        );
        
        [SerializeField] private GetInteger m_Index = new GetInteger();
        
        [SerializeField] private GetVector3 m_Value = new GetVector3();
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Translation Offset");
            return $"{this.m_ParentConstraint} {method} ({this.m_Index}, {this.m_Value})";
        }
        
        protected override Awaitable Run(Args args)
        {
            ParentConstraint component = this.m_ParentConstraint.Get<ParentConstraint>(args);
            if (component == null) return Done;
            
            component.SetTranslationOffset(
                (int) this.m_Index.Get(args),
                (Vector3) this.m_Value.Get(args)
            );
            
            return Done;
        }
    }
}


```

