LNXSDK/leenkx/Sources/leenkx/logicnode/NavigableLocationNode.hx
2025-01-22 16:18:30 +01:00

26 lines
483 B
Haxe

package leenkx.logicnode;
import iron.math.Vec4;
import leenkx.trait.navigation.Navigation;
class NavigableLocationNode extends LogicNode {
var loc: Vec4;
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
#if lnx_navigation
assert(Error, Navigation.active.navMeshes.length > 0, "No Navigation Mesh Present");
Navigation.active.navMeshes[0].getRandomPoint(function(p: Vec4) {
loc = p;
});
#end
return loc;
}
}