Unity: how to determine turret rotation direction if it has to be limited, and target "passed behind"? : Started some programming in Unity just for fun a couple days ago.
So far my game (pretty much top-down shooter) consists of player flying in an asteroid field, in which lurk enemy ships. Player can shoot down asteroids and enemies, and enemy ships have missile turrets that "track" player. 

Everything works fine until I decided that enemy ships shouldn't be able to rotate their turrets all the 360-way.
Think of it as real-world battleship being unable to turn it's front turret (No.1) 180 degrees behind because turret No.2 is in the way.

Currently code for turret rotation is like this:
```
playerTarget = GameObject.FindGameObjectWithTag("Player");
chaseDirection = Quaternion.LookRotation(playerTarget.transform.position - transform.position);
newYaw = Mathf.Clamp(chaseDirection.eulerAngles.y, minYaw, maxYaw);
transform.rotation = Quaternion.Euler(0, newYaw, 0);
```
That works okay, until player flies BEHIND enemy ship. As soon as player gets into turret's "possible rotation angle", it just snaps past "dead zone" to new direction.
That looks ugly.

I thought about coding enemy to start rotating turret in counter-direction as soon as player passes "directly behind" the turret "forward facing" position. But the concept of how to do that eludes me.
Cause as soon as turret rotates just a bit from limit, it's able to turn "towards" player again, and gets stuck at limit again.
I think I am doing something very wrong and missing some easy and logical answer, but it eludes me for several hours already.