This is my onready variable for my boss health bar, it is inside 'World.gd'

onready var BossBar = get_node("/root/World/GUI/CanvasLayer/BossHealth")

This is my function, calling show()

BossBar.show()

For some reason, when I get to this line, and try to use the function, it says:

"Invalid call. Nonexistent function 'show' on base 'Nil'".

My ProgressBar node is in my scene tree. Why does this happen?

    Add before that line:
    print_tree()

    And check the output to see if that node path is correct for the scene tree.

      Use this instead, to print the entire scene tree:
      get_tree().get_root().print_tree()

      So using get_root() on the scene tree returned the same error, however, using: ‘get_node(“/root/“).print_tree()’ I found the path, and it matched up with my path…

      You can click the Remote tab on the left when the game is playing. Likely the tree is not what you think, or you misspelled something.

      sahildoesstuff
      Can you call BossBar.show() inside of _ready function and see if same error appears?
      You can get nil value if you try to call BossBar.show() inside of _init function.

        AspireMint Using it in the ‘ready()’ function works! Using it in the ‘physics_process()’ function also works. However, using it in my function, ‘boss_start()’ does not.

          sahildoesstuff
          Probably BossHealth isn't "ready" - in your node tree, put breakpoint to your line BossBar.show() and do what cybereality suggest you to do. See what is at that moment in node tree.

            AspireMint Everything looks fine, it is a child of CanvasLayer, GUI, and World. The path matches up. But, instead of using get_node() I saved the boss health node as a scene, and then I made a singleton for boss_health and called the show() function on the auto-loaded singleton. This might not be the best way to do this, but it worked. Not sure why...

            Thanks for everybody's help.