Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Parent Constraint Locked#

Animation / Constraints / Parent Constraint / Parent Constraint Locked

  • Can Read

  • Can Write

Description#

The Locked property of the Parent Constraint component

Code#

// <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
{
    [Get]
    [Set]
    
    [Title("Parent Constraint Locked")]
    [Category("Animation/Constraints/Parent Constraint/Locked")]
    [Description("The Locked property of the Parent Constraint component")]
    
    [Image(typeof(IconHanger), ColorTheme.Type.Pink)]
    [Keywords("Socket, Ancestor, Keep, Track, Follow")]
    
    [Serializable]
    public class GenTypeBool_ParentConstraint_Locked : TypeBool
    {
        [SerializeField] private GetGameObject m_ParentConstraint = new GetGameObject(
            new GenTypeGameObject_ParentConstraint()
        );
        
        public override bool GetPreview(GameObject source)
        {
            GameObject instance = this.m_ParentConstraint.GetPreview(source);
            if (instance == null) return default;
            
            ParentConstraint component = instance.GetComponent<ParentConstraint>();
            return component != null ? component.locked : default;
        }
        
        public override bool Get(Args args)
        {
            ParentConstraint instance = this.m_ParentConstraint.Get<ParentConstraint>(args);
            return instance != null
                ? instance.locked
                : default;
        }
        
        public override void Set(bool value, Args args)
        {
            ParentConstraint component = this.m_ParentConstraint.Get<ParentConstraint>(args);
            if (component != null) component.locked = (bool) value;
        }
        
        public override string ToString()
        {
            return $"{this.m_ParentConstraint} Locked";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.