- Edited
Currently, my understanding is that preload
is better for use at runtime than load
because it ensures the resource is loaded before the game starts, preventing a performance hiccup that may have occurred with load
.
However, I'm a bit confused as to how preload can work that way if there are no active scripts that call preload
until after the game has already started. For example, I have a script for a projectile that loads in another scene to store as a variable using preload
. This projectile is only spawned when the player attacks, so there is no code to load in this scene until the player shoots the projectile. This doesn't cause any noticeable performance issues, but this could just be because I'm loading a very small scene off an SSD.
So what I'm wondering is, does Godot load in the preload
scene at startup, or does the scene not load until the projectile is spawned, because that's where the script to load in the scene is?