Help in Godot 4 needed!

Hey guys,

We (my friends and I) are currently programming a Point & Click Puzzle Game in Godot 4 and are facing a few struggles…

Question: How do we make two items interact with each other? Or create a chain of events?

For example: Selected Item in Inventory (key) > click on Item in the Environment (chest) > chest opens/asset of open chest visible >chest has other collectible item in it that appears in the inventory when you click on it

Any help appreciated! Thanks :slight_smile:

To help you, it would be good to know what you have implemented for now. For example you can create a click-manager, which calls a given method (“click”) on the object that has been clicked (if necessary with given arguments).
Then you can implement this clicked method on every thing that you are supposed to be able to click:

# Example script for a chest

func click(inventory):
    if inventory.has(key):
        open()
    else:
        ... #display message that an item is missing or something else

func open():
    ... #code to display open chest and other stuff
1 Like