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