Mobile behaviour

22 views
Skip to first unread message

Outpost 31

unread,
Sep 23, 2017, 10:37:25 AM9/23/17
to CoSpaces Scripting
Just wondering why my code for speech does not activate when I load this space on mobile but it does on desktop?
and I'll just ask again, there is no way on mobile to link out as I am currently linking to Sketchfab on desktop to show items in 3D? And just wondering if there was any hint of when you might get the ability to place stl's into CoSpaces?
Amazing platform so far, thanks for answering all our questions!
Screen Shot 2017-09-23 at 7.33.13 AM.png

Pavel Kakolin

unread,
Sep 23, 2017, 10:56:14 AM9/23/17
to cospaces-...@googlegroups.com
Hi Outpost 31,

Your script does not work on mobile because of the content of the "Coding" block:


This code will not work on mobile devices as it was previously stated here.

Also, currently we do not support `let` inside "Coding" block: although it might work in browsers, it won't work on mobile. If you want to have consistent behaviour of you script across browser and mobile devices, please stick to ES5 inside "Coding" blocks. And by the way you don't need "Coding" block to define a variable and give it a string value: this can be done by standard blocks from "Variables" section.

Regarding your other questions: currently we don't have a way to link out of CoSpaces using script that would work both in browser and mobile apps, but we might introduce it in the future.

Import of stl files is still work in progress and we will inform you as soon as it is ready, please follow updates in our facebook group and CoSpaces Edu newsletter.

Outpost 31

unread,
Sep 23, 2017, 11:52:35 AM9/23/17
to CoSpaces Scripting
Thanks for your response.  Sorry I don't understand what you mean when you say " And by the way you don't need "Coding" block to define a variable and give it a string value: this can be done by standard blocks from "Variables" section." could you give me an example?

Pavel Kakolin

unread,
Sep 23, 2017, 11:59:35 AM9/23/17
to cospaces-...@googlegroups.com
Sure.

In your "Coding" block you define a variable named url using let expression and give it a value of https://sketchfab.com/models/dcb0bef3f65a4aafb715433de8d1ff8e. Just like I said above, currently we do not support let expressions in "Coding" blocks: such scripts won't work in mobile applications. But the same can be done using blocks from "Variables" category and this will work on mobiles as well as in browser:


Outpost 31

unread,
Sep 23, 2017, 12:49:41 PM9/23/17
to CoSpaces Scripting
Thanks for the advice, it seems though that when I do your method nothing activates, the lamp has a transparent wall over it and the trophy is a jpeg

here are the links

Screen Shot 2017-09-23 at 9.48.05 AM.png

Pavel Kakolin

unread,
Sep 23, 2017, 12:52:51 PM9/23/17
to cospaces-...@googlegroups.com
"set" block is only used to assign a value to a variable. It won't open the link in a browser or perform any other actions. You can read more about variables and related blocks here.

Outpost 31

unread,
Sep 23, 2017, 1:07:52 PM9/23/17
to CoSpaces Scripting
ok thnx, so just to be clear the only way I am linking out is using that coding block which will work on a desktop but none of my code will work in mobile

Pavel Kakolin

unread,
Sep 23, 2017, 1:13:13 PM9/23/17
to CoSpaces Scripting
Yes, of course we still need to provide a method that will allow you to link to external content working both on mobile and desktop. We will keep you posted about our progress on this.

What I'm trying to say here is that let inside "Coding" block will make your whole program crash with syntax error and not work entirely on mobile: that's why the man does not speak on activate on mobile when there is a "Coding" block with let statement inside.

To avoid this you can use "set" block instead of let statement inside "Coding" block. This of course does not imply that you don't need to open the url with open(url); statement inside "Coding" block, but although it won't open the link on mobile, it also won't crash the whole script and at least makes man to speak on activate :)

Outpost 31

unread,
Sep 23, 2017, 1:16:34 PM9/23/17
to CoSpaces Scripting
Awesome, just checked it and he can now talk on mobile, thanks for being so patient and quick to respond, there is so much to learn!
Reply all
Reply to author
Forward
0 new messages