From 941d879184556debb9105f1fb19797e2a9e80a0f Mon Sep 17 00:00:00 2001 From: sebashtioon Date: Sun, 25 Aug 2024 12:00:25 +1000 Subject: [PATCH] FINAL FIX FOR INVENTORY UI! --- Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd | 7 +++---- player.dat | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd b/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd index 7bd93a5b..525e539d 100644 --- a/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd +++ b/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd @@ -103,14 +103,13 @@ func _physics_process(delta): if not is_on_floor(): velocity.y -= gravity * delta - # Allow gravity but prevent movement when the inventory is open + # Handle movement restrictions when the inventory is open if GAME_STATE == "INVENTORY": - # If the player was in the air when the inventory was opened and they just landed, stop movement - if inventory_opened_in_air and is_on_floor(): + # If the player is on the ground when the inventory is opened or lands, stop movement + if is_on_floor(): velocity.x = 0 velocity.z = 0 inventory_opened_in_air = false # Reset the flag once player lands - move_and_slide() # Apply gravity and handle movement return diff --git a/player.dat b/player.dat index aa5129af..1d9883c5 100644 --- a/player.dat +++ b/player.dat @@ -1 +1 @@ -{"GAME_STATE":"NORMAL","Health":72,"Position":{"x":-29.9095649719238,"y":24.386905670166,"z":20.3818187713623}} +{"GAME_STATE":"NORMAL","Health":72,"Position":{"x":-25.1203689575195,"y":24.3869037628174,"z":27.6839046478271}}