---
tags:
    - "Physics, 3D"
---

# Set Articulation Body Automatic Center Of Mass

[Physics 3D](../index.md) / [Articulation Body](index.md) / **Set Articulation Body Automatic Center Of Mass**

## Description

Sets the Automatic Center Of Mass property of Articulation Body component

## Parameters

| Name | Description |
| :--- | :---------- |
| Articulation Body |  |
| 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;

namespace VisualScript.Runtime
{
    [Title("Set Articulation Body Automatic Center Of Mass")]
    [Category("Physics 3D/Articulation Body/Automatic Center Of Mass")]
    [Description("Sets the Automatic Center Of Mass property of Articulation Body component")]

    [Image(typeof(IconPhysics), ColorTheme.Type.Lime, typeof(BadgeDot))]
    [Keywords("Physics, 3D")]

    [Parameter("Articulation Body")]
    [Parameter("Value")]

    [Serializable]
    public class GenInstructionBool_ArticulationBody_SetAutomaticCenterOfMass : Instruction
    {
        [SerializeField] private GetGameObject m_ArticulationBody = new GetGameObject(
            new GenTypeGameObject_ArticulationBody()
        );

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

        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Automatic Center Of Mass");
            return $"{this.m_ArticulationBody} {member} = {this.m_Value}";
        }

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

            component.automaticCenterOfMass = (bool) this.m_Value.Get(args);

            return Done;
        }
    }
}
```

