a

Instance child scene vs preload() function

Adrian Cabornay(adriangdquest)

Good day,

Adrian here,

In my current understand, I believe that preload() function is the same as Instance child scene.

Why do we still need to use preload() fuction, if we can just just use "instance child scene" to add ScoreRow scene as a child of the Scoreboard scene?

Thanks in advance,

  • Nathan Lovato replied

    Hi Adrian,

    Instantiating and loading are two different things. Loading a scene reads the content of a scene file from the disk and puts it in the computer's memory as a resource. This loaded resource is not a scene instance: It's a template that can be used to create instances of the scene.

    Instantiating a scene can only be done on a loaded scene and creates a reproduction of the loaded resource.