Click out of cospaces

98 views
Skip to first unread message

Outpost 31

unread,
Jul 22, 2017, 11:41:31 AM7/22/17
to CoSpaces Scripting
Is there a blockly or JS script that will create an item that when clicked, can take you to another website in another tab? 

Benjamin Singh

unread,
Jul 24, 2017, 4:20:50 AM7/24/17
to CoSpaces Scripting
Hi,

yes you can use the open() function for this. But it just works in the browser, not in the mobile apps.

let button = Scene.createItem('LP_Cube', 0, 0, 0);

button.say('Click here.');

button.onActivate(function() {
    open(url, '_blank');
});

Link to example scene: https://cospac.es/b4AG

Benjamin

Outpost 31

unread,
Jul 24, 2017, 11:23:48 AM7/24/17
to CoSpaces Scripting
Thnx for that, could that be added to the mobile app, or is that not possible?

Benjamin Singh

unread,
Jul 24, 2017, 12:00:07 PM7/24/17
to CoSpaces Scripting
Technically it should be possible but I'm not sure about this functionality in general.

For example, how should a function like this behave in VR mode? Imagine you're using CoSpaces with a VR headset and walking inside a scene. Then you click on an object and the CoSpaces app closes and the browser app on your phone opens with the given url. The browser isn't a VR app. Therefore you need to take the phone out of the headset to browse the web because first you can't see anything through the glasses and second you can't interact with the touchscreen to browse the web. Then if you want to go back you need to close the browser, open CoSpaces again, put the phone back into the headset to continue where you left off?

Benjamin

Outpost 31

unread,
Jul 25, 2017, 9:16:05 PM7/25/17
to CoSpaces Scripting
Yes, so true, best left to desktop

Stiev Stigma

unread,
Aug 30, 2017, 6:21:42 PM8/30/17
to CoSpaces Scripting
Let's not be so hasty! I actually have a case where this is a feature I would need and believe it would benefit others. For example, I'm developing experiences on a number of different cloud-based VR platforms and the ability to have them linked to each other would be fantastic! There's no issue of browsing a non-vr web here as the url would link directly to another vr "room". In fact, on the Vizor.patches platform, I have started a VR browser that already can link to my CoSpaces experiences but it dead ends there because the link is one-way.

Being as forward thinking as possible here, but isn't this how you end up with a vast multi-verse of user generated realities? Isn't this one of the ultimate goals with VR in general? Please don't keep CoSpaces an island. Just my two cents.

Outpost 31

unread,
Aug 30, 2017, 7:50:00 PM8/30/17
to CoSpaces Scripting
That's awesome. Would it be possible to make that link two way?

Outpost 31

unread,
Sep 28, 2017, 9:21:10 AM9/28/17
to CoSpaces Scripting
When you say technically it is possible to link out of VR mode, is that a code that I can create? Currently when I click on the item in VR mode it does not activate the link. I don't mind about linking to a browser and taking the phone out, as in Sketchfab you can then go back into cardboard mode once you click on the model.  I suppose this all won't matter once we can add stl's to CoSpaces but still new functions like AR in Sketchfab are pretty amazing and being able to link out in mobile would be a useful function. Just wondering if with some code it's possible?
Screen Shot 2017-09-28 at 6.13.25 AM.png

Benjamin Singh

unread,
Oct 2, 2017, 2:52:25 AM10/2/17
to CoSpaces Scripting
Hi,

yes it's technically possible but it must be implemented in our App and exposed as an API. Your code won't work on mobile. At the moment the window.open() function just works in the web app because it's part of the Browsers API, not the CoSpaces API. I'll talk to the team about having a feature like this on mobile as well.

Benjamin

Outpost 31

unread,
Oct 5, 2017, 10:35:20 PM10/5/17
to CoSpaces Scripting
Great, thanks for the response
Reply all
Reply to author
Forward
0 new messages