My code won't run sometimes

26 views
Skip to first unread message

Rob McElroy

unread,
Aug 23, 2017, 3:25:01 AM8/23/17
to CoSpaces Scripting
I want to create a VR BreakoutEDU but when people click on the link


the code fails to run

can you please check it out

Thanks

Rob

Stefan Filff

unread,
Aug 23, 2017, 3:58:43 AM8/23/17
to CoSpaces Scripting
Hey Rob,

I checked out your space and noticed that this is an issue with the way blockly executes code from top to bottom, and left to right. In your example, we'd have to wait for your blockly actions with the Tie fighter and Shuttle to finish before we apply any click-logic to objects.

You need to re-arrange the blocks so that the click-behaviour is happening before the other blocks. This can be done by moving the onActivate blocks up, or putting them into a bigger function which is called at the beginning of the Scene.

This is how you can re-adjust your blockly code for it to work. 


I hope this helps. Let me know if you encounter any other problems!

Cheers,
Stefan

Rob McElroy

unread,
Aug 23, 2017, 10:55:09 PM8/23/17
to CoSpaces Scripting
Thanks Stefan!

That worked


Reply all
Reply to author
Forward
0 new messages