I created a UI element for a Resident Evil 4-like inventory system. Inside it is a GridContainer that holds all the slots that are added as children in code using a for loop. For some reason when I code in an icon to occupy a slot position's global_position it keeps going to origin of the GridContainer instead of the slot. When I print each slots' global_position within the main loop it is showing the origin of the GridContainer despite being arranged properly within the GridContainer. If I interact with the any slot with a mouse click and print the global_position it displays the correct position. Could this be related on how things are drawn/rendered in Godot, and if so, how would I go about fixing it?
Any ideas?