using UnityEngine;
public class MyTest : MonoBehaviour
{
public Transform cameraTransform;
public Transform target;
void Update()
{
float angle = Vector3.Angle(cameraTransform.forward, target.position - cameraTransform.position);
Debug.LogError("夹角:" + angle);
}
}
Angle between Unity camera orientation and target
Guess you like
Origin blog.csdn.net/a0_67/article/details/131601146
Recommended
Ranking