How to use the .gltf extension aniamsyonu in godot

I am new to Godot, I am working with Godot version 4.2.1, I am developing a small application on the desktop, I have a ball in my 1st scene, I have an object above, the ball is moving, I have an animation with gltf extension, the animation has been added to a scene called animation.tscn in the 2nd scene, the name of the animation is set to Animation, when this ball hits the object, the ball and object will disappear, I want my animation to be active.

my piece of code for the ball

extends RigidBody2D

var launcher_position
var shooting = false

func _process(delta: float) -> void:
	if Input.is_action_just_pressed("click"):
		launcher_position = get_global_mouse_position()
		shooting = true

	if shooting:
		var current_position = get_global_mouse_position()
		var dir = (current_position - launcher_position).normalized()
		linear_velocity = dir * delta * 60000

	if Input.is_action_just_released("click"):
		shooting = false


When importing gltf files there is a dropdown in the import meny for the gltf scene (not godot scene) and you should be importing your gltf animation as an AnimationLibrary, which will save only the animation from that gltf file. After that you will have to attach an AnimationPlayer as a child of the ball and add the animation inside it. Then you can trigger the animation via code by calling AnimationPlayer.play([animation_name]).