Godot Version
4.4
Question
I am trying to make a tool script to show some visuals in the editor in order to make my inventory system more usable, but I’m having trouble accessing variables right now I’m using this line
if get_parent().MyItem != null:
Display(get_parent().MyItem, get_parent().MyCount)
but when the node this script is on doesn’t have the right parent with the MyItem
variable it returns an error, this makes sense to me, but I can’t figure out a way to do this without an error, other things I have tried are lines like if get_parent().get_script() == (pre)load("Script.gd")
but this didn’t work either, what am I missing?