Problem with acceleration

expired_012expired_012 Member Posts: 1,802
edited November -1 in Working with GS (Mac)
Hola-

Im having a problem with the accelerometer right now. My game is in portrait mode btw. So i have an actor and I want him to move only left and right (no up and down) using the accelerometer. Here are my rules:

Move right:
When game.Accelerometer.X < 0.5

accelerate direction 0

Move left:

When game.accelerometer.x > -0.5

accelerate direction 180

It works in the GS preview but the acceleration wont work on my device. Anyone know what I did wrong?

Comments

  • ShpintShpint Member Posts: 404
    Tshirt booth has a video on that in his YouTube channel
  • expired_012expired_012 Member Posts: 1,802
    Yeah I know but the tutorial is using acceleration in the landscape orientation, and mine is in portrait and it works differently
  • Stryfe01Stryfe01 Member Posts: 146
    Dude I have some of the same issues. I am so frustrated with this SDK right now. Not hijacking your thread, but some things should be simple. Can't we get a simple left and right action? And a jumping action?
  • Rob2Rob2 Member Posts: 2,402
    Holding phone upright portrait (eg standing on dock hole) tilt left x<0 tilt right x>0

    so to have a reasonable null spot left when x<-0.15 right when x>0.15

    at .5 you are already leaning by about 20 degrees it all depends how sensitive you want it to be
  • Rob2Rob2 Member Posts: 2,402
    the way you have it you are moving left and right together!! eg when x=0 both rules are met!
  • expired_012expired_012 Member Posts: 1,802
    @Rob2, thanks it works now :)
Sign In or Register to comment.