---
tags:
    - "Location, Follow, Transform"
---

# Set Position Constraint Locked

[Animation](../../index.md) / [Constraints](../index.md) / [Position Constraint](index.md) / **Set Position Constraint Locked**

## Description

Sets the Locked property of Position Constraint component

## Parameters

| Name | Description |
| :--- | :---------- |
| Position Constraint |  |
| 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("Set Position Constraint Locked")]
    [Category("Animation/Constraints/Position Constraint/Locked")]
    [Description("Sets the Locked property of Position Constraint component")]
    
    [Image(typeof(IconPosition), ColorTheme.Type.Pink)]
    [Keywords("Location, Follow, Transform")]
    
    [Parameter("Position Constraint")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenInstructionBool_PositionConstraint_SetLocked : Instruction
    {
        [SerializeField] private GetGameObject m_PositionConstraint = new GetGameObject(
            new GenTypeGameObject_PositionConstraint()
        );
        
        [SerializeField] private GetBool m_Value = new GetBool();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Locked");
            return $"{this.m_PositionConstraint} {member} = {this.m_Value}";
        }
        
        protected override Awaitable Run(Args args)
        {
            PositionConstraint component = this.m_PositionConstraint.Get<PositionConstraint>(args);
            if (component == null) return Done;
            
            component.locked = (bool) this.m_Value.Get(args);
            
            return Done;
        }
    }
}


```

