- Home /
Question by
iamthecoolguy11 · Feb 17, 2014 at 08:02 PM ·
c#rotationtransform
How to get my own rotation
I am making a crazy moment thing but I need to find my own rotation.
here's the script
using UnityEngine; using System.Collections;
public class Movement : MonoBehaviour { public GameObject waste; public float x = 0.0f; public float y = 0.0f; public float z = 0.0f;
void Update()
{
//trying to get my own rotation here
x = transform.rotation;
y = transform.rotation;
z = transform.rotation;
}
}
Comment
Best Answer
Answer by RedDevil · Feb 17, 2014 at 08:05 PM
use this.transform.rotation (this refers to the object the script is on)
Your answer
![](https://koobas.hobune.stream/wayback/20220613133837im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Why is this rotation acting odd? 0 Answers
transform.forward doesn't work in my code 3 Answers
Quaternions acting up 1 Answer
Rotate angle 0 Answers