Answers for "get the y axis rotation of gameobject unity"

C#
1

rotation around own axis in unity

transform.RotateAround(transform.position, transform.up, Time.deltaTime * 90f);
Posted by: Guest on March-19-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

Code answers related to "get the y axis rotation of gameobject unity"

C# Answers by Framework

Browse Popular Code Answers by Language