Limit shooting angle.

Hi guys.

I searched around and didn’t find anything like that i need. So in my game (its a space game) the player must select a target and the idea is to make auto shooting. Every gun shoots on its own until the angle doesn’t allow it. Thats the idea. Since it’s a space game i have no clue how to get the angle between the player and the target and put limits to it… Thanks for reading.

Here are some links: