Answers for "unity agent look at"

C#
0

unity agent look at

private void FaceTarget(Vector3 destination)
{
    Vector3 lookPos = destination - transform.position;
    lookPos.y = 0;
    Quaternion rotation = Quaternion.LookRotation(lookPos);
    transform.rotation = Quaternion.Slerp(transform.rotation, rotation, [fill in desired rotation speed]);  
}
Posted by: Guest on January-27-2021

C# Answers by Framework

Browse Popular Code Answers by Language