rj-action-library/Runtime/Actions/Node3D/LerpPosition.cs

31 lines
516 B
C#

using Godot;
namespace Rokojori
{
[GlobalClass ]
public partial class LerpPosition : RJAction
{
[Export]
public Node3D sourceA;
[Export]
public Node3D sourceB;
[Export]
public float lerp;
[Export]
public Node3D target;
public override void _OnTrigger()
{
if ( sourceA == null || sourceB == null || target == null )
{
return;
}
target.GlobalPosition = sourceA.GlobalPosition.Lerp( sourceB.GlobalPosition, lerp );
}
}
}