How to implement movement via mobile sensors

Hi guys,

i am new to the Entire game developing scene, i am not that well versed in coding nor i am a designer,

i am trying to make a small puzzle game for android, where the player / object movement is based on “tilt / Rotation” though i know few actions and conditions are present in Gdevelop, i am not quite sure how to utilize them, can any one help me?

thanks :slight_smile:

You can use the conditions that check for orientation and motion of the device. To use them, you can go to Sensors drop down and choose a condition. To learn more about this category, you can check out the device sensors wiki page.

1 Like

thanks piyush, i was really feeling lost… thanks for the help ^^

1 Like

i happen to come across example script where its used to move a ball, incidentally i was also trying to move a ball like object, i tried implementing the same code, it didnt work when i built it and used it on my phone… what couldve been the issue?

It is difficult to say without seeing your code
post it please

1 Like

i actually made it work, the issue was my default control option was checked on the player and also few conditions i was using to check for movement like " keypress condition " were still there so maybe coz of that, not sure. … i ended up removing them and it worked… now i am stuck with how to trigger animation based on mobile sensors…

you could simulate a keypress when the sensor does what you want, I think the object must have platformer behaviour. So for example when phone is turner right, simulate key cursor right and the player should start moving.

1 Like

really need to try that… i am brand new to game designing !!! :frowning: plus can u help me understand how to add Animation to sprite based on sensor movement… and how to transition between two different sprite animation

sorry but i haven’t worked with sensors.
You can take a look at the platform tutorial, there is the animation of olayer running and jump ing.
Then you have to adapt it as a reaction to the sensor you want to use

1 Like