Accelerometer Issue

This is really puzzling me. I want to use the accelerometer to move an object left or right across the screen. What is happening is if you start up the game and then press the button to play it works fine. If you start up the game and let it sit at the title screen, or browse other options at the title screen the accelerometer does its own thing when you start to play. It seems to be storing positions the entire time you sit at the title screen and then going through them when you start the game.

I do not add the accelerometer event until the gameplay starts which really confuses me. When you are at the title screen or in the options it should not even be tracking the accelerometer because the event is not added yet. The longer you let it sit the longer it does it’s own thing when you start. If I start the game and let it sit for a minute at the title screen and then play, for the first 3 or 4 second the object just stays in the middle. Likewise if I tilt the device while at the title screen the object will rapidly do those movements when you start the game.

I could understand this better if I added the accelerometer event from the start, but it is not even added until you click Play at the title screen.

Any thoughts or suggestions would be greatly appreciated. I am out of things to try. I have tried just turning on the event from start and it does the same thing.

Thanks [import]uid: 8533 topic_id: 8332 reply_id: 308332[/import]

Are you using global variables that could interfere with the accelerometer? Maybe there’s something in the title screen that interferes with the function of the accelerometer, delaying the function to be called or something? Try narrowing it down then post some code [import]uid: 14018 topic_id: 8332 reply_id: 29737[/import]

I got things working now. It ended up being fixed my lowering system.setAccelerometerInterval. I had it at 60 and lowering it to 45 seemed to solve the problem.

Thanks for the response. I did check over variables as you suggested, but that did not seem to be the case. All locals were involved.
[import]uid: 8533 topic_id: 8332 reply_id: 29766[/import]