/// --------------------------------------------- /// Behavior Designer /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- namespace Opsive.BehaviorDesigner.Samples { using Opsive.BehaviorDesigner.Runtime.Tasks; using Opsive.BehaviorDesigner.Runtime.Tasks.Actions; using Opsive.GraphDesigner.Runtime.Variables; using UnityEngine; /// /// Teleports the character to the specified location. /// [Shared.Utility.Category("Behavior Designer Samples")] public class Teleport : Action { [Tooltip("The teleport location.")] [SerializeField] protected SharedVariable m_Location; /// /// Teleports the character. /// /// Success after the character has teleported. public override TaskStatus OnUpdate() { m_Transform.SetPositionAndRotation(m_Location.Value.transform.position, m_Location.Value.transform.rotation); return TaskStatus.Success; } } }