diff --git a/Sources/armory/logicnode/TweenFloatNode.hx b/Sources/armory/logicnode/TweenFloatNode.hx index 8e8f25152..ea221655b 100644 --- a/Sources/armory/logicnode/TweenFloatNode.hx +++ b/Sources/armory/logicnode/TweenFloatNode.hx @@ -13,6 +13,7 @@ class TweenFloatNode extends LogicNode { public function new(tree:LogicTree) { super(tree); + tree.notifyOnRemove(onRemove); } override function run(from:Int) { @@ -111,4 +112,10 @@ class TweenFloatNode extends LogicNode { function done() { runOutput(2); } + + function onRemove() { + if(anim != null){ + Tween.stop(anim); + } + } } \ No newline at end of file diff --git a/Sources/armory/logicnode/TweenRotationNode.hx b/Sources/armory/logicnode/TweenRotationNode.hx index 31a3bb76a..6282731c7 100644 --- a/Sources/armory/logicnode/TweenRotationNode.hx +++ b/Sources/armory/logicnode/TweenRotationNode.hx @@ -14,6 +14,7 @@ class TweenRotationNode extends LogicNode { public function new(tree:LogicTree) { super(tree); + tree.notifyOnRemove(onRemove); } override function run(from:Int) { @@ -112,5 +113,11 @@ class TweenRotationNode extends LogicNode { function done() { runOutput(2); - } + } + + function onRemove() { + if(anim != null){ + Tween.stop(anim); + } + } } \ No newline at end of file diff --git a/Sources/armory/logicnode/TweenTransformNode.hx b/Sources/armory/logicnode/TweenTransformNode.hx index d9bd7adbf..a0cde031a 100644 --- a/Sources/armory/logicnode/TweenTransformNode.hx +++ b/Sources/armory/logicnode/TweenTransformNode.hx @@ -22,6 +22,7 @@ class TweenTransformNode extends LogicNode { public function new(tree:LogicTree) { super(tree); + tree.notifyOnRemove(onRemove); } override function run(from:Int) { @@ -125,5 +126,12 @@ class TweenTransformNode extends LogicNode { function done() { runOutput(2); - } + } + + function onRemove() { + if(anim != null){ + Tween.stop(anim); + } + } + } \ No newline at end of file diff --git a/Sources/armory/logicnode/TweenVectorNode.hx b/Sources/armory/logicnode/TweenVectorNode.hx index 763822864..af1af45b9 100644 --- a/Sources/armory/logicnode/TweenVectorNode.hx +++ b/Sources/armory/logicnode/TweenVectorNode.hx @@ -14,6 +14,7 @@ class TweenVectorNode extends LogicNode { public function new(tree:LogicTree) { super(tree); + tree.notifyOnRemove(onRemove); } override function run(from:Int) { @@ -112,5 +113,11 @@ class TweenVectorNode extends LogicNode { function done() { runOutput(2); - } + } + + function onRemove() { + if(anim != null){ + Tween.stop(anim); + } + } } \ No newline at end of file