Articulation Body Set Drive Limits#
Physics 3D / Articulation Body / Articulation Body Set Drive Limits
Description#
Executes the Set Drive Limits method on the Articulation Body component
Parameters#
| Name | Description |
|---|---|
| Axis | |
| Lower | |
| Upper |
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;
namespace VisualScript.Runtime
{
[Title("Articulation Body Set Drive Limits")]
[Category("Physics 3D/Articulation Body/Set Drive Limits")]
[Description("Executes the Set Drive Limits method on the Articulation Body component")]
[Image(typeof(IconPhysics), ColorTheme.Type.Lime, typeof(BadgeDot))]
[Keywords("Physics, 3D")]
[Parameter("Axis")]
[Parameter("Lower")]
[Parameter("Upper")]
[Serializable]
public class GenInstructionArticulationBody_SetDriveLimits_3 : Instruction
{
[SerializeField] private GetGameObject m_ArticulationBody = new GetGameObject(
new GenTypeGameObject_ArticulationBody()
);
[SerializeField] private ArticulationDriveAxis m_Axis = default;
[SerializeField] private GetNumber m_Lower = new GetNumber();
[SerializeField] private GetNumber m_Upper = new GetNumber();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Set Drive Limits");
return $"{this.m_ArticulationBody} {method} ({this.m_Axis}, {this.m_Lower}, {this.m_Upper})";
}
protected override Awaitable Run(Args args)
{
ArticulationBody component = this.m_ArticulationBody.Get<ArticulationBody>(args);
if (component == null) return Done;
component.SetDriveLimits(
this.m_Axis,
(float) this.m_Lower.Get(args),
(float) this.m_Upper.Get(args)
);
return Done;
}
}
}