Difference between published build and editor


Just published my PlayHack entry, and found out that on the iPhone the accelerometer no longer works to turn the rocket.

When playing from the iPhone from inside the Editor, everything works fine

Any ideas about this difference and how to resolve it?


Maybe this is related to various motion events being deprecated if you are not running from HTTPS. Try running your published build but replace http with https. Then your devicemotion events should work, however you might get some errors about resources that are loaded from http, which you can then fix by making sure that those resource are also loaded via https.

Hi Vaios,

Thanks for your reply.

Sadly it doesn’t work from https as well.


Even from the Editor I don’t seem to have great control over the rocket by moving my iPhone 6. :confused: It’s hard to tell if I’m affecting it’s trajectory.

The thing that troubles me is that the same codebase runs differently after publishing it.

I am printing now the gyro (beta and gamma) angles (bottom left of screen), so you can have a look.

The window.ondevicemotion event doesn’t return anything. Tried to implemented a generic framework like gyro.js but the result is the same. It doesn’t work on the published version.

iPhone 5c

From inside the editor hitting Play:

Directly accessing the published version (tried both http and https):

Hmm, I we had a problem accessing deviceorientation events from inside an iframe on iOS.

If you try using the “embed” link: https://playcanv.as/e/p/eKXIxyHT

Does that work?

The main difference between published and editor launched games is that publishing puts the content in an iframe.

Yes, Dave, this works correctly. Thank you.

Are you going to make an update to the Play button on the project page? Just to be sure my entry on the competition is playable.

Best regards,

We can’t change the play link to use the embed address as it is just a redirect to the raw files.

I’ll try and look into this and see if this is an issue with our implementation or a bug in iOS. But I know that we’ve demoed device orientation on Android.

Hey Dave,

Just saw in the newsletter the way that you will judge the playhack games.

Are you going to take into account this bug?

Because using the accelerometer is the main controller on mobile in my game, but on iOS it doesn’t work using the Play button. Only using the link you posted above.

Best regards,

@dave can you comment on my last question?

Deadline is tomorrow, and accelerometer is still not available when hitting the Play button from iOS.

We know about this issue, so it won’t affect the judging.