diff --git a/Sources/armory/logicnode/LerpVectorsNode.hx b/Sources/armory/logicnode/LerpVectorsNode.hx index 32312cd..973e7ec 100644 --- a/Sources/armory/logicnode/LerpVectorsNode.hx +++ b/Sources/armory/logicnode/LerpVectorsNode.hx @@ -10,6 +10,7 @@ class LerpVectorsNode extends LogicNode { var t=0.0; var c:Float; var f=0.0; + var abo:Bool; public function new(tree:LogicTree) { super(tree); @@ -19,16 +20,21 @@ class LerpVectorsNode extends LogicNode { v1 = inputs[1].get(); v2 = inputs[2].get(); t = inputs[3].get(); - f = (t / iron.system.Time.delta); + + f = (t / iron.system.Time.delta); } - override function get(from:Int):Dynamic { + override function get(from:Int):Dynamic { + abo = inputs[4].get(); + trace(t); + if (abo) { + t = 0; + } if (v1==null) { return null; c=1; } - if (t>=0) { - trace(t); + if (t>0) { v.x=v1.x+((v2.x-v1.x)/f)*c; v.y=v1.y+((v2.y-v1.y)/f)*c; v.z=v1.z+((v2.z-v1.z)/f)*c; diff --git a/blender.py b/blender.py index 42827cc..413e2d8 100644 --- a/blender.py +++ b/blender.py @@ -234,6 +234,7 @@ def init(self, context): self.inputs.new('NodeSocketVector', 'Starting Vector') self.inputs.new('NodeSocketVector', 'End Vector') self.inputs.new('NodeSocketFloat', 'Time For Change') + self.inputs.new('NodeSocketBool', 'Stop Interpolation') self.outputs.new('NodeSocketVector', 'Vector') def register():