how to find angle with x and y components UNITY 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);