![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | StankWilliams |
I think this question is pretty basic and I’m missing something simple… but I’m just starting out
My hierarchy is this…
A Scene for a specific Character
- Node2D named “Character”
- Sprite2D “CharacterSprite”
At the parent node I have a script with the following…
extends Node2D
class_name Character
#
@export var CharacterSheet : Resource
# Called when the node enters the scene tree for the first time.
func _ready():
$CharacterSprite.texture = CharacterSheet.Visual
My intentions are for every Scene where this Character Node is added, attach a Resource to the variable CharacterSheet which itself has the variable Visual. Here’s that resource:
extends Resource
class_name CharacterSheet
#
@export var Visual : Texture2D
Even after I link the Resource to the Character Node, I’ve got nothing shown when ran. If I manually put the .png in to the Sprite2D and remove my assignment it appears, so I’m assuming I’m close… Do I have my hierarchy/ordering wrong somewhere?