From d4164c994e93e6a9284f6aa45ded9e95c36c8a41 Mon Sep 17 00:00:00 2001 From: Willow Behar <2364126-TechRunner@users.noreply.gitlab.com> Date: Fri, 10 May 2024 11:22:24 -0500 Subject: [PATCH] Added Global Variable in settings for the last known location and is updated when player starts coughing --- Assets/scripts/global_settings.gd | 2 ++ Assets/scripts/player.gd | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Assets/scripts/global_settings.gd b/Assets/scripts/global_settings.gd index 47133d6..d05489c 100644 --- a/Assets/scripts/global_settings.gd +++ b/Assets/scripts/global_settings.gd @@ -3,3 +3,5 @@ extends Node var is_paused = false var current_map = "" + +var Player_Last_Location = Vector3(0,0,0) diff --git a/Assets/scripts/player.gd b/Assets/scripts/player.gd index 0a37a17..df2e320 100644 --- a/Assets/scripts/player.gd +++ b/Assets/scripts/player.gd @@ -20,10 +20,12 @@ func set_condition(con): $Node3D/VapeLight.off() $"Coughing Recovery".start() $"Severe Coughing Timer".stop() + GlobalSettings.Player_Last_Location = global_transform.origin CONDITION.SEVERE_COUGHING: $Node3D/VapeLight.off() $"Severe Coughing Recovery".start() $"Coughing Timer".stop() + GlobalSettings.Player_Last_Location = global_transform.origin var will_cough = false var timealive = 0