How do I orientate a spite’s motion to device tilt

Get help using Construct 2

Post » Thu Jun 06, 2013 10:00 am


First off I’m pretty new to Construct, so if I’m making any newbie mistakes in how I’m going about trying to accomplish my goal please don’t judge too harshly.

That said I’m currently trying to get a sprite (with bullet motion) to orientate its angle of motion toward a mobile device’s left-right tilt. Currently I set the angle of motion of the “player” sprite toward Touch.Gamma degrees every tick (see the attached project file). The result of this is the sprite changing direction almost randomly when I tilt my device.

What I’d like to be able to do is always have the “player” sprite moving toward the top of the device but have its motion veer to the left when the user tilts the device to the left and to the right when the device is tilted to the right.

Thanks for your help :D
Posts: 1
Reputation: 127

Post » Thu Jun 06, 2013 7:09 pm

did u use the touch object it gives the rotation of the device
Posts: 514
Reputation: 9,636

Return to How do I....?

Who is online

Users browsing this forum: mrkaio, Zav and 2 guests