How to write a script to destroy enemy once player circles around

I made a spaceship that has a trail renderer which makes it seem like it dispenses a line. I want the enemy to be destroyed once the spaceship fully circles the enemy using the line. How would i go about scripting this. Any help would be appreciated.
Thanks for your help.

You will need to keep track of the ship’s position every update, and basically build a line from it’s start position to it’s end.
Then you’ll need to check if you’ve made a closed loop. I’m not sure how exactly to do that, but you probably could mathematically figure it out. In 2D it would be easier than in 3D. I would suggest getting some graph paper and working it out on paper first.

Good Luck.