Answers for "unity rotation to quaternion"

C#
1

2 rotation unity

// Rotation scripting with Euler angles correctly.
// Store the Euler angle in a class variable, and only use it to
// apply it as a Euler angle, but never rely on reading the Euler back.
        
float x;
void Update () 
    {
        x += Time.deltaTime * 10;
        transform.rotation = Quaternion.Euler(x,0,0);
    }
Posted by: Guest on January-20-2020
0

unity rotation to quaternion

using UnityEngine;public class Example : MonoBehaviour
{
    void Start()
    {
        // A rotation 30 degrees around the y-axis
        Quaternion rotation = Quaternion.Euler(0, 30, 0);
    }
}
Posted by: Guest on February-09-2020

Code answers related to "unity rotation to quaternion"

C# Answers by Framework

Browse Popular Code Answers by Language