Quaternion.Slerp not rotating over 180 degrees unity code example
Example 1: 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);
}
}
Example 2: unity rotate quaternion around axis
RoatationVar = Quaternion.Euler(Vector3.up) * camera.rotation;