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