Use Accelerometer Real ball rolling

themagicboxthemagicbox Member, PRO Posts: 82
This is an old post i found and when i tried it out, it didnt work...It just stayed in the same placed no matter how much i tilted the device..im testing it on android adhoc..

this is the post

https://forums.gamesalad.com/discussion/4645/use-accelerometer-real-ball-rolling

has something changed?

is there another way to achieve this? i would like the ball on screen to act like it was a real ball...so if you were to to tilt it a lot, it would move faster. like the ball in the labyrinth games.. it would also be colliding with walls and stuff.

Comments

  • themagicboxthemagicbox Member, PRO Posts: 82
    can anyone please help me with this? is there some demo i can use? i have honestly spent the last 4 hours testing different settings and i cant get it to move right according to the accelerometer...over 25 adhoc builds trying to get this and it really feels pointless now because nothing is working...i cant find any reliable resources on how to do this as well and i didnt think this would be a difficult thing. This is already my third attempt at making a game since the first 2 didnt work out too well because of the limitations of gamesalad...please anyone know how to do this?
  • ericzingelerericzingeler Member Posts: 334
    @themagicbox

    Here's a project file for you I just whipped up. This method takes the Accelerometer X & Y raw input data, applies a low pass filter to smooth things out, is then multiplied and inserted into the scene gravity.

    There is three balls of different sizes in the scene. The heaviness effect is controlled by the drag attribute of each ball. Applying more drag simulates a heavier object, increases dead zone and smoothness; but, decreases accuracy and responsiveness.

    See scene > gravity actor for filter function. If you're interested in understanding how that works, Google: low pass filter accelerometer.

    Post if you have any questions. Hope this helps you out, good luck!

    https://dl.dropboxusercontent.com/u/27937751/gs/modules/BallsTableTilt_05_23_2013.gameproj.zip
  • themagicboxthemagicbox Member, PRO Posts: 82
    holy crapppp this is EXACTLY what i needed thank you so much i dont know how i can repay you hahahha
Sign In or Register to comment.