Accelerometer

bradenpowellbradenpowell Member Posts: 16
edited November -1 in Working with GS (Mac)
I am trying to make a game that turns a object based on how you rotate it.
my rule is:

game.accelerometerY > 2
then rotate rotate counter-clockwise
other wise - rotate clockwise

game.accelerometerY < -2
then rotate - clockwise
other wise - rotate counter clockwise

(this is supposed to be when the device is facing me)

Whenever I test this it rotates clockwise and won't do anything else no matter what way I tilt my device. And keeps turning when laid flat. Anyone know what the problem is?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Your rules go against each other

    Your second rule is setup to rotate everything greater than -2 counter clockwise but then you first rule makes everything less the 2 go clockwise. So you have to rules telling it to do 2 different things when the value is -1.9 thru 1.9
  • bradenpowellbradenpowell Member Posts: 16
  • bradenpowellbradenpowell Member Posts: 16
    So what do I need to do so it is fixed?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Re work your rule so nothing is conflicting with the other rules
  • ultimaultima Member, PRO Posts: 1,207
    keeping on the same topic i know he'll run into this issue after the rules is correct.. anyone has formula that stabilizes the accelerometer?(well the number that's outputted anyway)
Sign In or Register to comment.