any way to cut vectors on the screen borders?

Hi

I’m trying to do an enemy tracking system where I will display an arrow on the borders of the screen pointing to where the enemy is located.

So far, my idea is to ray cast from the center of the screen to the enemy and get that vector. If I draw a line from the center of the screen using that, it seems to work nicely but the problem is that I only want to display a texture (arrow) on the screen border.

Is there a way to ‘cut’ the vector at the border, get that point and display the texture there?

Regards,
Joaquin

Currently being discussed here.