unity 2d calculate angle between directions code example
Example: get angle between two vectors unity
Vector3 targetDir = target.position - transform.position;
float angle = Vector3.Angle(targetDir, transform.forward);
Vector3 targetDir = target.position - transform.position;
float angle = Vector3.Angle(targetDir, transform.forward);