Hi! I have already asked this question on the forum, but no one answered me, I hope they will answer me. I'm implementing a 2D game with a top view. I have a ready-made hotbar with a selection system, and I'm trying to implement an interactive system with objects. For example, when a player chooses a wooden block, he can set it (it will be his own code) or a sword that can be hit (it will be his own code). However, I came across the fact that scripts are activated for all items in slots. If anyone helps, I will be grateful! I am attaching a video with scripts like mine and a screenshot of the "itemdata" script.
https://youtu.be/DaZsCPuDJ5c?si=U6U92dnUQEhvWIGV
Implementing a hotbar that triggers animation for items in Godot 4
-
Asset Used -
Effects (Pick the free one) - https://bdragon1727.itch.io/super-package-retro-pixel-effects-32x32-pack-2
Items - https://clockworkraven.itch.io/free-rpg-icon-pack-100-weapons-and-po-clockwork-raven-studios -
Code -
Item (Resource) - https://pastebin.com/aH6D7tuy
...