App.touch is null in Playcanvas 1.10

Span up my project this morning to a strange new error: basically ‘this.app.touch’ is null, within postinitialise; obviously that’s pretty significant for just about any game! I see that playcanvas has had an update to v1.10 yesterday and suspect this is related?

Is there a way to force a rollback to an earlier runtime in the editor?

Quick edit: I’m on a windows surface pro, and saw this in Chrome - I can confirm this wasn’t an issue with playcanvas 1.9.

If I check (“ontouchstart” in window), this returns false in Chrome - I think this may be what playcanvas is using internally to decide whether to launch touch handling?

Oddly (“ontouchstart” in window) returns true in Firefox, so I’m now doubting the latest Chrome…

Chrome 70: Enabled by default - I think this is my issue… https://www.chromestatus.com/feature/4764225348042752

There’s a couple suggestions to allow feature detection without using “ontouchstart” in window:

  • It is suggest to use PointerEvent APIs to better support both touch and mouse.

  • Site should use navigator.maxTouchPoints for touchscreen detection, and Windows.TouchEvent for TouchEvent feature detection.

I guess mine is an edge case affecting touch enabled Windows machines - but prior to the Chrome update I had touch capabilities in PlayCanvas; not so anymore on Windows surface (and equivalent, I’d guess). I’ll switch to Firefox for now, but I think maybe something needs to change inside the Playcanvas engine to detect touch capabilties without recourse to “ontouchstart” in window…

Thanks @inductible we are looking into this.

Yes, check out this page:

https://developer.playcanvas.com/en/user-manual/scripting/custom_engine/

So, for you, you’d add:

?use_local_engine=https://code.playcanvas.com/playcanvas-1.9.0.js

…to your launch URL. Or change the ? to an & if you already have URL query parameters in your launch URL.

1 Like