We need something to shoot
Create a new scene with Area2D as root
Add a VisibleOnScreenNotifier2D
Add Square.png as texture
Select the CollisionShape2D
Now set the Layer and Mask
export a variable for speed
create a variable for direction
Connect the VisibleScreenNotifier2D
The bullet scene can be used by the Player or the UFO
Create a function to assign it to the UFO
Connect the body entered signal
If the bullet hit the player
Set the angle of the bullet to match
Rename it to ShootingPoint
Add a script to ShootingPoint
Export access to the bullet scene
Create a function to shoot
If bullet scene is not assigned exit
Instantiate the bullet scene
Match the position and rotation
Add a reference to the ShootingPoint
Connect the area entered signal
Call the on destroy function