Godot Version
4.1.1
Question
I have two scripts: PickaxeSwing and PickaxeAnimGetter
PickaxeSwing:
extends CollisionShape2D
var pickaxeanim
var pickaxecollision
func ready():
pickaxecollision = $"."
pickaxecollision.set_deferred("disabled", true)
print("URRRHRG")
func _process(delta):
pickaxecollision = $"."
pickaxecollision.set_deferred("disabled", true)
PickaxeAnimGetter.pickaxeanim_visible_off()
PickaxeAnimGetter:
extends AnimatedSprite2D
var pickaxeanim
# Called when the node enters the scene tree for the first time.
func _ready():
pickaxeanim = $"." # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
pickaxeanim = $"."
func pickaxeanim_visible_off():
pickaxeanim = $"."
pickaxeanim.visible = false
print("got it")
func pickaxeanim_visible_on():
pickaxeanim.visible = true
The script is printing “got it” every tick, so it’s making it to the correct function, just not working. The pickaxe sprite is not turning invisible.