Answers for "unity transform.lookat only in one axis"

C#
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

Code answers related to "unity transform.lookat only in one axis"

C# Answers by Framework

Browse Popular Code Answers by Language