Problems with app

41 views
Skip to first unread message

Jowito 2000

unread,
Oct 8, 2017, 3:49:08 PM10/8/17
to CoSpaces Scripting
Hi again. well I'm here again because we are just having the same problem with the app. The script code does'nt work in mobiles. We put it in the app. when when we tap the play button it just charge the world. but it doesn't move and don't do anything. is there any way to make it work?

Benjamin Singh

unread,
Oct 9, 2017, 4:08:50 AM10/9/17
to CoSpaces Scripting
Hi,

can you please share the space with us so we can have a look at your latest script? 

Thanks,
Benjamin

Edson Fernandez

unread,
Oct 9, 2017, 12:09:04 PM10/9/17
to CoSpaces Scripting
This is our space where we are working on.

https://cospac.es/XxOt

Benjamin Singh

unread,
Oct 10, 2017, 4:12:24 AM10/10/17
to CoSpaces Scripting
Hi Edson,

thanks for sharing your script. First of all, very cool camera movement!

Regarding the issue on mobile. The problem is that the setTimeout() method isn't available on mobile. This method is just accessible in the browser. There it is exposed by the global window object which is provided by the browser environment. But the CoSpaces mobile app isn't running in the browser. Therefore this method doesn't exist there. In general, if you want that your script is running on mobile like expected don't use any Web APIs.

So to make your code work on mobile replace the setTimeout() method with Scene.schedule(). Which behaves the same. The difference is that it takes seconds instead of milliseconds as the second argument and it's not optional, you need to pass it.

Here is the corrected ruta() function:

function ruta(){
   
Scene.schedule(Conejo, 0);
   
Scene.schedule(Tiempo1, 3);
   
Scene.schedule(Tiempo2, 4.5);
   
Scene.schedule(Tiempo3, 6.5);
   
Scene.schedule(Tiempo4, 8);
   
Scene.schedule(Tiempo5, 10);
   
Scene.schedule(Tiempo6, 12.5);
   
Scene.schedule(Tiempo7, 16);
   
Scene.schedule(Tiempo8, 19.5);
   
Scene.schedule(Tiempo9, 21.1);
   
Scene.schedule(Tiempo10, 23.2);
}

Benjamin

Jowito 2000

unread,
Oct 10, 2017, 5:19:40 AM10/10/17
to CoSpaces Scripting
Okey. Thank you very much. We will try to fix it
Reply all
Reply to author
Forward
0 new messages