loading resources with gdscript
Godot - game development for homies » Devlog
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)
Godot - game development for homies
Status | Released |
Author | Bastian |
Genre | Educational |
Tags | Godot |
More posts
- i was wrong!6 days ago
- physics collision and layers7 days ago
- tool ghosts8 days ago
- storing player position8 days ago
- component campfire8 days ago
- how to control things in a scene component8 days ago
- camera 2D8 days ago
- component : fadein10 days ago
- blocking my view eh?10 days ago