Articulation Body Add Force#
Physics 3D / Articulation Body / Articulation Body Add Force Force, Mode
Description#
Executes the Add Force method on the Articulation Body component
Parameters#
| Name | Description |
|---|---|
| Force | |
| Mode |
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 Add Force")]
[Category("Physics 3D/Articulation Body/Add Force", "Force, Mode")]
[Description("Executes the Add Force method on the Articulation Body component")]
[Image(typeof(IconPhysics), ColorTheme.Type.Lime, typeof(BadgeDot))]
[Keywords("Physics, 3D")]
[Parameter("Force")]
[Parameter("Mode")]
[Serializable]
public class GenInstructionArticulationBody_AddForce_2_Vector3Force_ForceModeMode : Instruction
{
[SerializeField] private GetGameObject m_ArticulationBody = new GetGameObject(
new GenTypeGameObject_ArticulationBody()
);
[SerializeField] private GetVector3 m_Force = new GetVector3();
[SerializeField] private ForceMode m_Mode = default;
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Add Force");
return $"{this.m_ArticulationBody} {method} ({this.m_Force}, {this.m_Mode})";
}
protected override Awaitable Run(Args args)
{
ArticulationBody component = this.m_ArticulationBody.Get<ArticulationBody>(args);
if (component == null) return Done;
component.AddForce(
(Vector3) this.m_Force.Get(args),
this.m_Mode
);
return Done;
}
}
}