Answers for "get transform rotation around axis unity"

C#
1

unity rotate around axis

transform.Rotate(axis, degrees);
Posted by: Guest on June-08-2020
1

look rotation only on y axis in unity

var dir = PlayerMovement.playerTransform.position - transform.position;
        Quaternion LookAtRotation = Quaternion.LookRotation(dir);

        Quaternion LookAtRotationOnly_Y = Quaternion.Euler(transform.rotation.eulerAngles.x, LookAtRotation.eulerAngles.y, transform.rotation.eulerAngles.z);
        transform.rotation = LookAtRotationOnly_Y;
Posted by: Guest on December-06-2020

C# Answers by Framework

Browse Popular Code Answers by Language