- Edited
I saw this question on another Godot qna site and someone answered to use an AnimatedSprite, but that's all they said, I do not know how to code this correctly, and I need to know how to use this so that the button that I'm making animates. If there's another way, tell me about it, but know that I am currently an amateur coder, so may you make the code simple, whether you help me with the AnimatedSprite, or you help me with different code to do the same thing, I'm thankful that you just help.
My code:
extends TextureButton
# Declare member variables here. Examples:
# var a = 2
# onready var anisprite = $AnimatedSprite
# Called when the node enters the scene tree for the first time.
func _on_TextureButton_mouse_entered():
$AnimatedSprite.play("default 1")
func _on_TextureButton_mouse_exited():
$AnimatedSprite.play("New Anim")
func _on_TextureButton_pressed():
get_tree().change_scene_("title.tscn")
I change it to title
because this scene is before the title scene