darceyo Don't use either. Never try to access parent nodes directly. Instead declare an export property in your child script and then in the Inpector panel assign the node that is somewhere up the tree.

@export var grid_container: GridContainer

But if you really want to do it: Use relative paths like in your first example, even if it looks ugly.

darceyo @onready var grid = $"root/world/gui/inventory/GridContainer"

Begin the path with "/root/".

darceyo It's to avoid tight coupling between components. Ideally your components further down the tree should have no knowledge of what is above the tree. One solution is to use signals to pass information upwards.

darceyo If you see something like ../../.. in your node paths, it's a solid indicator that your project architecture is bad and you should rethink it, following the hints @Toxe laid out above.