Set Collider Is Trigger#
Physics 3D / Collider / Set Collider Is Trigger
Description#
Sets the Is Trigger property of Collider component
Parameters#
| Name | Description |
|---|---|
| Collider | |
| Value |
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("Set Collider Is Trigger")]
[Category("Physics 3D/Collider/Is Trigger")]
[Description("Sets the Is Trigger property of Collider component")]
[Image(typeof(IconSphereSolid), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Parameter("Collider")]
[Parameter("Value")]
[Serializable]
public class GenInstructionBool_Collider_SetIsTrigger : Instruction
{
[SerializeField] private GetGameObject m_Collider = new GetGameObject(
new GenTypeGameObject_Collider()
);
[SerializeField] private GetBool m_Value = new GetBool();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Is Trigger");
return $"{this.m_Collider} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
Collider component = this.m_Collider.Get<Collider>(args);
if (component == null) return Done;
component.isTrigger = (bool) this.m_Value.Get(args);
return Done;
}
}
}