rokojori_action_library/Runtime/Behavior/FollowBehavior.cs

26 lines
431 B
C#

using Godot;
using Rokojori.Extensions;
namespace Rokojori;
[Tool]
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Action.svg")]
public partial class FollowBehavior:BehaviorSequence
{
[Export]
public BehaviorMovement movement;
[Export]
public Node3D target;
protected override void _OnTrigger()
{
if ( movement != null )
{
movement.Follow( target );
}
base._OnTrigger();
}
}