- Home /
Measure rotation of an object
Hello, I've been having a bit of trouble with measuring an objects rotation.
I have a "skateboard" object that rotates in different directions (from user input) when its not colliding with anything. I want to measure how many rotations this object completes. So I have a coroutine that gets started when the skateboard leaves any collision which looks like this:
public IEnumerator RotationMeasurmentCoroutine (){ While(!isGrounded){
yield return null;
}
}
I've tried multiple different ways of tracking its rotation but i seem to always end up with huge numbers randomly, and with eulerangles i have trouble that it flips from 0 to 360 when the axis is going negative. I want to measure each individual axis (x,y ,and z) so that i can get a solid value for a full 360 rotation. I would like so that when one of the axis is rotating in a negative fashion that it will produce a negative number.
basically it doesn't have to correlate with eulerangles or any other rotation because it will not be used to move anything and so if 1 full rotation on the x axis can provide me with the same number consistently (positive or negative) that's fine for this.
Some help would really be appreciated, I'm certainly lost and i have failed to find another answer that fits what I'm looking for.
Answer by 1sd15 · Nov 14, 2017 at 08:37 PM
I think you can do this using EulerAngles and IF Statements, not really got the time at the moment to make a script for you. This was made in 2015, yeah? Well try reposting this question as you haven't gotten a reply within 24hours (or two years.)
Your answer
![](https://koobas.hobune.stream/wayback/20220613194114im_/https://answers.unity.com/themes/thub/images/avi.jpg)