Answers for "unity transform.lookat"

C#
3

unity look at target

transform.LookAt(target.transform.position);
Posted by: Guest on June-06-2020
0

unity transform.lookat only in one axis

var lookPos = target.position - transform.position;
lookPos.y = 0;
var rotation = Quaternion.LookRotation(lookPos);
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * damping);
Posted by: Guest on September-23-2021

C# Answers by Framework

Browse Popular Code Answers by Language