- Edited
I have a scene with a weapon resource that has an image and a sprite child node
class_name Player extends CharacterBody2D
@onready var weapon_sprite: Sprite2D = $Weapon
@export var weapon: Weapon:
set(value):
print(value.name)
weapon_sprite.texture = value.texture
weapon = value
The thing is that because I start my player with an instance of weapon assigned, the property setter assigns the weapon texture to the sprite texture before its ready.
Is there any way to get around this or fix it?