using Godot; namespace Rokojori { [GlobalClass] public partial class PlaceRandomly : RJAction { [Export] public Node3D start; [Export] public Node3D end; [Export] public Node3D target; public override void _OnTrigger() { var lastNode = target.GetChild( target.GetChildCount() - 1 ); var rnd = LCG.Randomized(); var randomPosition = rnd.InCube() ; randomPosition *= ( end.GlobalPosition - start.GlobalPosition ); randomPosition += start.GlobalPosition; RJLog.Log( "Position", randomPosition ); lastNode.GlobalPosition = randomPosition; } } }