- Vector3 playerPos = mapTarget.position;
- Vector3 objectPos = pair.Key.position;
- playerPos.y = objectPos.y = 0f;
- Vector3 direction = playerPos - objectPos;
- float angle = Mathf.Atan2( direction.x, direction.z ) * Mathf.Rad2Deg;
- pair.Value.rotation = Quaternion.AngleAxis( -angle, Vector3.up ) * compassMeshObject.rotation;