loading resources with gdscript


version 3.5.2 topic loading resources

While defining a variable sometimes you need to say where the resource is. For example an texture you need to set somewhere where character sheet is. Do it like this.

1.define a string var with the path to the texture Player is the global name of the script in autoload in which i have

var Player = {
  portrait = "res:blablabla.png",
}

2.in the scene _ready(): put it like this $SpritePortrait.texture = load(player.portrait)