Hi. I am trying to make something happen only if the player is looking approximately in the targets position. I tried to use the Quaternion.Angle function but it only works if the enemy is looking at the player, And stops working when the enemy turns away.
This is how i did it.
if(Quaternion.Angle(transform.rotation,pc.target.transform.rotation) > 170
&& Quaternion.Angle(transform.rotation,pc.target.transform.rotation) < 190){
My question is how can i ignore where the enemy is looking and only compare the players rotation with the targets rotation?