Sprite not hiding on load?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ThomaRoma

I’m trying to make a sprite hide upon load.
But unfortunately, it doesn’t hide on load for some reason.
I’m using an Area2D detection on an object, right? And I already implemented a display function that’ll make the sprite shown when the player is in the area. I also made it hide while/if the player is outside the area.

However, the following isn’t working so well:

func _onready():
   self.hide()

Any help would be much appreciated! <3

So this is found in the _ready() function, or is it found in a signal called _onready()?

Ertain | 2018-10-04 14:27

:bust_in_silhouette: Reply From: TheMadScientist1234

I think the function _ready() is the one your looking for. It gets called when the node gets loaded into the tree.

func _ready():
    self.hide()