vector3 to quaternion unity3d code example
Example 1: how to convert vector3 to quaternion
Quaternion rot = Quaternion.Euler(V3.x, V3.y, V3.z);
Example 2: how to turn 3 floats into quartenion
using UnityEngine;public class Example : MonoBehaviour
{
void Start()
{
// A rotation 30 degrees around the y-axis
Quaternion rotation = Quaternion.Euler(0, 30, 0);
}
}