playMaker

Author Topic: Stop Unity Flip Axes when I turn the object  (Read 2788 times)

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Stop Unity Flip Axes when I turn the object
« on: April 27, 2015, 05:07:06 PM »
Hi

I have a 3d-Ring which I use as Slider to change the soundvolume.
I tried this with Mouselook and it works nicely but when i use GetRotation for the X-Axis it always flips y and z when x hit 90 degrees.

So the numbers are positive. Is there a way to stop this.
Because i need the value from 0-360.

Does anybody has an idea?

Thanks

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Stop Unity Flip Axes when I turn the object
« Reply #1 on: April 27, 2015, 05:51:30 PM »
Can you post some screen shots?

flora

  • Playmaker Newbie
  • *
  • Posts: 47
Re: Stop Unity Flip Axes when I turn the object
« Reply #2 on: April 30, 2015, 08:07:40 AM »

May be you could add a rigidbody to the ring (uncheck gravity if you need to), then in the freeze rotation  tab: check Y and Z ... it should do the trick.

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Stop Unity Flip Axes when I turn the object
« Reply #3 on: April 30, 2015, 03:42:54 PM »
@Flora

No it still does the same. Maybe i will try another way to rotate this.
I tried this allready.

But thank you for your help.
Another idea?^^

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Stop Unity Flip Axes when I turn the object
« Reply #4 on: April 30, 2015, 06:41:03 PM »
So the Object starts at 0.
When i move left. it goes till 90. This is right but if i go on it goes back from 90 to 0. Because it flips y and z to 180 at x=90.
In the other direction it looks like this.
It goes from 360 to 270 and if i goe on it goes from 270 to 360. x and y also flip at 270.

I tried some other rotation type than mouse look alwas the same. So it musst be something from unity i use wrong.

I need the x rotation value from x for a formula. But beacause the x value jumps like this the results are wrong.

Does anybody has another idea how to get the rotation value