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

# Parent Constraint Get Translation Offset

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

## Description

Compares the Get Translation Offset method of Parent Constraint component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Parent Constraint |  |
| 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 Get Translation Offset")]
    [Category("Animation/Constraints/Parent Constraint/Get Translation Offset")]
    [Description("Compares the Get Translation Offset method of Parent Constraint component to another value")]

    [Image(typeof(IconHanger), ColorTheme.Type.Pink)]
    [Keywords("Socket, Ancestor, Keep, Track, Follow")]

    [Parameter("Parent Constraint")]
    [Parameter("Index")]
    [Parameter("Value")]

    [Serializable]
    public class GenConditionVector3_ParentConstraint_CheckGetTranslationOffset_1 : Condition
    {
        [SerializeField] private GetGameObject m_ParentConstraint = new GetGameObject(
            new GenTypeGameObject_ParentConstraint()
        );

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

        [SerializeField] private GetInteger m_Index = new GetInteger();

        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Get Translation Offset");
            string parameters = $"({this.m_Index})";
            return $"{this.m_ParentConstraint} {method} = {this.m_Value}";
        }

        protected override bool Run(Args args)
        {
            ParentConstraint component = this.m_ParentConstraint.Get<ParentConstraint>(args);
            if (component == null) return false;

            Vector3 value = component.GetTranslationOffset(
                (int) this.m_Index.Get(args)
            );

            return value == (Vector3) this.m_Value.Get(args);
        }
    }
}
```

