From cf21d3facecfc0af1fa1739ac80bb78c092cbdc4 Mon Sep 17 00:00:00 2001 From: Jerald-Golden-B Date: Wed, 24 Sep 2025 18:27:14 +0530 Subject: [PATCH] movement bug half fixed --- .../human/instances/animator/manufacturerAnimator.tsx | 5 ++++- .../simulation/human/instances/animator/workerAnimator.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/modules/simulation/human/instances/animator/manufacturerAnimator.tsx b/app/src/modules/simulation/human/instances/animator/manufacturerAnimator.tsx index 904cec3..d7b0147 100644 --- a/app/src/modules/simulation/human/instances/animator/manufacturerAnimator.tsx +++ b/app/src/modules/simulation/human/instances/animator/manufacturerAnimator.tsx @@ -30,6 +30,8 @@ function ManufacturerAnimator({ path, handleCallBack, human, reset }: Readonly { if (!human.currentAction?.actionUuid) return; + completedRef.current = true; + if (human.currentPhase === "init-manufacture" && path.length > 0) { setCurrentPath(path); setObjectRotation((action as HumanAction)?.manufacturePoint?.rotation ?? null); @@ -64,7 +66,7 @@ function ManufacturerAnimator({ path, handleCallBack, human, reset }: Readonly { if (!human.currentAction?.actionUuid) return; const action = getActionByUuid(selectedProduct.productUuid, human?.currentAction?.actionUuid || ""); + completedRef.current = true; + if (human.currentPhase === "init-pickup" && path.length > 0) { setCurrentPath(path); setObjectRotation((action as HumanAction).pickUpPoint?.rotation ?? null); @@ -74,7 +76,7 @@ function WorkerAnimator({ path, handleCallBack, human, reset, startUnloadingProc lastTimeRef.current = now; const object = scene.getObjectByProperty("uuid", human.modelUuid); - if (!object || currentPath.length < 2) return; + if (!object || currentPath.length < 2 || completedRef.current) return; if (isPaused || !isPlaying) return; let totalDistance = 0; @@ -150,6 +152,7 @@ function WorkerAnimator({ path, handleCallBack, human, reset, startUnloadingProc setCurrentAnimation(human.modelUuid, human.currentMaterials.length > 0 ? "idle_with_box" : "idle", true, true, true); progressRef.current = 0; movingForward.current = !movingForward.current; + completedRef.current = true; setCurrentPath([]); handleCallBack(); if (human.currentPhase === "pickup-drop") {