Accelerometer Movement (Is the Wiki Now Wrong)
Jel
Member Posts: 319
I've gone back to some old projects to update them to iOS4 and the accelerometer seems to be the opposite of what it use to be in GS 0.?
I though it may just be my games but I've just create a test accelerometer game and they do not match the Wiki's way of doing it http://gamesalad.com/wiki/how_tos:gsc_key_and_accelerometer_movement
I.E. to go up game.accel X > 0.1 works correctly but in the Wiki it says to use game.accel X < -0.1
I've uploaded a very simple accelerometer test game --> http://gamesalad.com/game/play/82097.
If you look at the rules instide Actor 1 you'll see that they are the opposite of what the Wiki says to do but the actor moves in the correct way.
Any help on this would be very much appreciated as I've tried the new rules in one of my games and although the actor moves in the correct way all the animation is wrong and would involve a lot of work to fix. Is there something simple I missed along the way with all the GS updates as I haven't worked on a project since April/May?
I though it may just be my games but I've just create a test accelerometer game and they do not match the Wiki's way of doing it http://gamesalad.com/wiki/how_tos:gsc_key_and_accelerometer_movement
I.E. to go up game.accel X > 0.1 works correctly but in the Wiki it says to use game.accel X < -0.1
I've uploaded a very simple accelerometer test game --> http://gamesalad.com/game/play/82097.
If you look at the rules instide Actor 1 you'll see that they are the opposite of what the Wiki says to do but the actor moves in the correct way.
Any help on this would be very much appreciated as I've tried the new rules in one of my games and although the actor moves in the correct way all the animation is wrong and would involve a lot of work to fix. Is there something simple I missed along the way with all the GS updates as I haven't worked on a project since April/May?
Comments
Did you check auto rotate off and is your format landscape or portrait as that makes a difference
GS keeps x as side to side when in portrait mode and y top to bottom but when you turn the device landscape with button on left x and y are still at the same they also rotate clockwise so now the - x up is the top and the +x is the bottom - y is the left and + y is the right
Thanks for the reply and sorry if this is a double post with a different title but I could feel the other one wasn't going anywhere.
Did you get a chance to look at my web demo game? How did it work on your device ?
I understand what the Wiki states and have been using those rules for the last year but now for some reason it work the opposite way round. So in landscape view +y is left and -y is right. I've tested this with another accelerometer demo ( http://gamesalad.com/game/play/29870 ) and it confirms that when tilted left it's +y and when tilted right -y.
(any)
if keyboard "down" is down
X > .1 move 270
if keyboard up is down
then X < -.1 move 90
and so on for the Y
all your device orientations and scene are the same as mine
i think your project is corrupt or my GS wont register the changes i make on your test
its in shared and my profile
I take it no one else has experienced this ?
I think I'm going to have to contact the developers directly.
Thanks CodeMonkey,
Your Accelerometer Test demo cleared it up for me with it's rotation settings. Although I did try changing the orientation of my game previously what stumped me was that you need to physically rotate the device the first time for the rotation to trigger and then it fixes.
Anyway seems to be all good now. Thanks again for the help.