Answers for "quaternion rotation unity"

C#
4

unity clamp rotation

float rotationX = 0;
float rotationY = 0;
// you might also have some rotation speed variable
void Update() {
   rotationX += Input.GetAxis("Vertical") * Time.deltaTime;
   rotationX = Mathf.Clamp(rotationX, minRotationX, maxRotationX);
   rotationY += Input.GetAxis("Horizontal" * Time.deltaTime;
   transform.rotation = Quaternion.Euler(rotationX, rotationY, 0);
 }
Posted by: Guest on January-06-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
0

quaternion rotation unity

using UnityEngine;

public class lerp_demo : MonoBehaviour
{
    Quaternion rot=new Quaternion(0.4f,0.5f,0.9f,1);
  
    void Start()
    {
       transform.rotation=rot;
        
    }
}
Posted by: GonaRip on June-30-2022

C# Answers by Framework

Browse Popular Code Answers by Language