I’m struggling with reversing the gravity dynamically when the device is in “portraitUpsideDown” orientation.
The code I have only works in portrait.
function onTilt( event )
if (system.orientation) == portraitUpsideDown
then
physics.setGravity( 5 \* event.xGravity, 10 \* event.yGravity )
else
physics.setGravity( 5 \* event.xGravity, -10 \* event.yGravity )
end
end
Thanks for taking a look!
[import]uid: 10763 topic_id: 17287 reply_id: 317287[/import]