I’m trying to add a split function to my game but i can’t seem to figure out how to, there are also no youtube videos what are up to date for this.
In more detail of what i’m trying to do is, i’m trying to make it so when i right click an item in my inventory it splits half the amount, and while holding the item in my inventory i can place one at a time when i right click, so basically just like in minecraft.
I am quite new to gdscript so i hope someone with more knowledge and experience can help me.
Let me know if there’s any more information and or clarification needed!
You probably have to add a method takeHalfStack() that reduces the amount to half and returns a copy of the object with the other half.
And add a insertSingleObject() that copys the current object with the amount of 1 and reduces the one you are holding by one