Godot Version
4.6.2
QuestionHow to change the button sprite in the clicker on Godot
I need to change the button sprite to a different image when I reach 20 clicks. I don’t understand how to do this. I have already created 2 TouchScreenButtons and set a picture for them when I click on the button. However, I need to make it so that 1 TouchScreenButton changes to 2 TouchScreenButtons when I reach 20 clicks.
extends Node2D
var clic = 0
var lv1 = 20
func _on_touch_screen_button_pressed() -> void:
clic += 1
print(clic)
func _physics_process(delta):
$Label.text = "СЧЁТ: " + str(clic)
if clic == 20:
???