diff --git a/Assets/Scripts/PickUpKeyCard.cs b/Assets/Scripts/PickUpKeyCard.cs index 1ecdbe91..b2fed543 100644 --- a/Assets/Scripts/PickUpKeyCard.cs +++ b/Assets/Scripts/PickUpKeyCard.cs @@ -46,6 +46,24 @@ public class PickUpKeyCard : MonoBehaviour if (Input.GetMouseButtonDown(0)) { + bool hasSpace = false; + foreach (var slot in playerInventory.slots) + { + if (slot == null) + { + hasSpace = true; + break; + } + } + + if (!hasSpace) + { + Debug.Log("Inventory is full!"); + if (interactionPrompt != null) + interactionPrompt.text = "Inventory full!"; + return; + } + isPickedUp = true; if (keyCardPlayer != null)