From 368cb904645b04b209761c3545ae146df252d3e6 Mon Sep 17 00:00:00 2001 From: Cat Flynn Date: Thu, 25 Mar 2021 11:58:40 +0000 Subject: [PATCH] respawn in middle of safe zone --- game/Assets/Scripts/Checkpoint/SafeZone.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/game/Assets/Scripts/Checkpoint/SafeZone.cs b/game/Assets/Scripts/Checkpoint/SafeZone.cs index cb35084..859b957 100644 --- a/game/Assets/Scripts/Checkpoint/SafeZone.cs +++ b/game/Assets/Scripts/Checkpoint/SafeZone.cs @@ -16,6 +16,9 @@ public class SafeZone : MonoBehaviour { if (other.gameObject.CompareTag(PLAYER)) { + // set position to middle of safe zone + _respawnPosition.Value = transform.position; + // start counting safe time when we enter a safe zone _safeTime.Value = 0; } @@ -26,8 +29,6 @@ public class SafeZone : MonoBehaviour // Check if other game object is Player. if (other.gameObject.CompareTag(PLAYER)) { - _respawnPosition.Value = other.gameObject.transform.position; - // TODO: does this have implications for the time freeze ability? _safeTime.Value += Time.deltaTime; }