Godot Version
4.3
Question
Hey y’all. I have a slight problem, this is what I’m doing; I have a inventory Control node that has a script attached that defines the behavior for the items in the slots, when you click on them, how they get moved around, etc. I’m trying to move those functions into a global autoload script called slotitemsbehavior and just keep the functions that trigger certain things within the inventory script itself. The reason being I think it would be better for multiplayer purposes where instead of every player holding a copy of those functions they instead can grab them from the autoload script so its just one instance of them at all times, (maybe this is not a good idea, you can lmk if you think so lol).
But the problem comes when i grab an item from a slot, its position should follow the mouse cursor much like minecraft or terraria inventories, yet the position goes to 0,0, (relative to node).
I was doing this right before I left the house so I have come up with some guesses as to the error. It could be that when I do add_child() from the autoload it adds it as child to the autoload node and not the inventory node, so maybe I can pass the inventory node as a parameter to the autoload scripts functions to get the add_child() to the right node.
I’m just not home right now so I wanted to get some thoughts on this, thank you.