Answers for "unity vector3 to rotation"

C#
1

rotation unity script 2d

transform.Rotate(Vector3(0, 0, 50));
//instead of :
transform.eulerAngles = new Vector3 (0, 0, 50);
//or like you said
transform.eulerAngles = Vector3.forward * 50;
Posted by: Guest on June-26-2020
1

unity rotate vector3

Quaternion rotation = Quaternion.Euler(x,y,z);
Vector3 myVector = Vector3.one;
Vector3 rotateVector = rotation * myVector;
Posted by: Guest on January-02-2021
1

rotation unity script 2d

transform.eulerAngles = Vector3.forward * degrees;
// or
transform.rotation = Quaternion.Euler(Vector3.forward * degrees);
// or
transform.rotation = Quaternion.LookRotation(Vector3.forward, yAxisDirection);
// or
transform.LookAt(Vector3.forward, yAxisDirection);
// or
transform.right = xAxisDirection;
// or
transform.up = yAxisDirection;
Posted by: Guest on June-26-2020

C# Answers by Framework

Browse Popular Code Answers by Language