Mobile functionality not working

Hi all,

I’m interested in starting to use the mobile functionality with p5, but when I check the examples on their site:

https://p5js.org/examples/mobile-tilted-3d-box.html
https://p5js.org/examples/mobile-acceleration-color.html
https://p5js.org/examples/mobile-shake-ball-bounce.html

The sketches load but don’t function as they should (when I move my phone nothing happens).

Does anyone have insight on this? I’m using an iPhone 7 Plus.

Thanks!
Tori

1 Like

Hello Tori

When Apple released Safari 13 for iOS, they made it mandatory to ask the user for permission before getting access to orientation and motion data. It’s a privacy thing.

There’s an open issue to handle this in the p5.js project. Until then, you could probably work around it yourself: How to Request Device Motion and Orientation Permission in iOS 13.

1 Like