respawn in middle of safe zone
This commit is contained in:
parent
07cebb6ea5
commit
368cb90464
|
@ -16,6 +16,9 @@ public class SafeZone : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (other.gameObject.CompareTag(PLAYER))
|
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
|
// start counting safe time when we enter a safe zone
|
||||||
_safeTime.Value = 0;
|
_safeTime.Value = 0;
|
||||||
}
|
}
|
||||||
|
@ -26,8 +29,6 @@ public class SafeZone : MonoBehaviour
|
||||||
// Check if other game object is Player.
|
// Check if other game object is Player.
|
||||||
if (other.gameObject.CompareTag(PLAYER))
|
if (other.gameObject.CompareTag(PLAYER))
|
||||||
{
|
{
|
||||||
_respawnPosition.Value = other.gameObject.transform.position;
|
|
||||||
|
|
||||||
// TODO: does this have implications for the time freeze ability?
|
// TODO: does this have implications for the time freeze ability?
|
||||||
_safeTime.Value += Time.deltaTime;
|
_safeTime.Value += Time.deltaTime;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue