Skip to content

Instantly share code, notes, and snippets.

@gkagm2
Created April 19, 2019 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gkagm2/1b429e116e4790f12c345c6dd1c62c1f to your computer and use it in GitHub Desktop.
Save gkagm2/1b429e116e4790f12c345c6dd1c62c1f to your computer and use it in GitHub Desktop.
Quaternion
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class csKeyMove : MonoBehaviour {
public float a;
public float x;
// Update is called once per frame
void Update () {
//Horizontal - Z axis
transform.rotation *= Quaternion.AngleAxis(a * 30.0f - 1 * Time.deltaTime, Vector3.forward); //기울일 각 과, 회전할 축
x += Time.deltaTime * 10;
transform.rotation = Quaternion.Euler(x, 0.0f, 0.0f); //기울일 각을 오일러로 표현한다.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment