From 346cbf1ba45498c429090051d118fcd59eabb7b1 Mon Sep 17 00:00:00 2001 From: Robert Dorn Date: Wed, 27 Nov 2024 15:04:59 +0100 Subject: [PATCH] fixed NaN on first process in onTick timeSinceLastTick --- src/BasicBehaveEngine/nodes/lifecycle/onTick.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BasicBehaveEngine/nodes/lifecycle/onTick.ts b/src/BasicBehaveEngine/nodes/lifecycle/onTick.ts index 326b019..b65bb3c 100644 --- a/src/BasicBehaveEngine/nodes/lifecycle/onTick.ts +++ b/src/BasicBehaveEngine/nodes/lifecycle/onTick.ts @@ -17,7 +17,7 @@ export class OnTickNode extends BehaveEngineNode { const tickTime = Date.now(); if (isNaN(this._startTime)) { this.outValues.timeSinceStart = {id: "timeSinceStart", value: [0], type: this.getTypeIndex('float')}; - this.outValues.timeSinceLastTick = {id: "timeSinceLastTick", value: [NaN], type: this.getTypeIndex('float')}; + this.outValues.timeSinceLastTick = {id: "timeSinceLastTick", value: [0], type: this.getTypeIndex('float')}; this._startTime = tickTime; } else { this.outValues.timeSinceStart = {id: "timeSinceStart", value: [tickTime - this._startTime], type: this.getTypeIndex('float')};