Browse Source

Update PlayerReplay.cs

Kenkart 2 years ago
parent
commit
e2a9479838
1 changed files with 3 additions and 2 deletions
  1. 3 2
      Assets/Scripts/PlayerReplay.cs

+ 3 - 2
Assets/Scripts/PlayerReplay.cs

@@ -297,11 +297,12 @@ public class PlayerReplay : MonoBehaviour
                 bc.endStepsPressed = false;
             }
 
+            // TODO: maybe need to check if body is null or not (after 6 seconds body is destroyed, destroy a destroyed gameobject error?)
+            Destroy(body);
+
             // Wait for input
             yield return ViveInput.WaitForControllerPress();
 
-            Destroy(body);
-
             if (finish)
                 break;
         }