Super sorry for the late reply, things got in the way when I first saw the reply and then I completely spaced it and the post got buried!
If the Fireball has a KinematicBody2D and is using velocity, then what I would recommend doing is simply setting the velocity of the KinematicBody2D so it points in the direction the fireball needs to go. So for the Node2D script, you could do something like this:
# Code for player
# ====
# after line 14, add the following:
clone.setup_fireball()
# ====
# Code for Node2D script
# ====
extends Node2D
var fireball_direction = Vector2.DOWN
export (float) var fire_move_speed = 100.0
func setup_fireball():
var kinematic_body = get_node("KinematicBody2D")
kinematic_body.velocity = fireball_direction * fire_move_speed
# _process not needed anymore, as the KinematicBody2D will handle moving the fireball
# ====
# Code for Kinematic Body can stay the same, it should work
For the teleporting backwards and then disappearing, it may be that left/right need to be swapped. So lines 8
and 10
in the player code for spawning the fireball may need to be adjusted. What you could try doing is adding something like this after 10
in the player code:
print ("Direction: ", direction, " | Vector: ", fireball_direction)
Which should print which direction the player is facing and which vector it is assigning it to. Then you can see if the left/right are incorrectly set and swap them as needed.
Another thing that could, maybe, be causing the teleportation is spawning the fireball right inside the player. If the player and the fireball both have collision scripts, it could be that the physics engine is pushing it out and that is causing the issue. What I would recommend doing is adjusting the code for the setting the global position slightly so there is a small offset:
# From this
clone.global_position = global_position
# To something like this (move it 10 pixels in the direction the player is shooting towards
clone.global_position = global_position + (fireball_direction * 10)