Different behaviors between desktop and mobile app

Hi, i’m experiencing a different behavior between desktop and mobile app, probably in the way desktop and mobile app deal with global variables. Did you already experienced that?

.mario

Hi @mariochiesa,

this sounds like an interesting bug. Can you share a space with us in which this bug happens?

Sure!


I checked several times but it seems all working in the desktop while in the app the behavior is not the intended one. But maybe it’s just a mistake like an elephant in the room i can’t see…
So the space starts with a small room and then you enter into the classroom.
On the chalkboard there’s a list of three small experience you can start by clicking on them.
When an experience ends, you go back to the classroom, and aside to the item on the list a check mark appears.
Once you have all the marks, you can go back to the first small room by clicking on the VR visor on the desk.
Using the desktop browser version it’s all fine; using the desktop app, all the marks are already visible on the chalkboard, like if the related control variables were already set to true…

In the small room i set each control var to false with the blockly javascript code Space.setProperty(“varname”, false)
In the classroom i check the varname value with a Space.getProperty(“varname”) assigned to another variable and if false i scale to 0.001 the check mark; with the mobile app they’re never scaled down
In the other scenes, when an experience is completed i set that control var to true with the blockly javascript code Space.setProperty

Thanks in advance,
.mario

Hi @mariochiesa,

the Space.setProperty method you are using is storing all values you pass as a string - type on mobile. This means that Space.setProperty("value", false) returns the string "false" when retrieved via Space.getProperty("value").

We are looking into solving this on mobile platforms. I recommend you to work with strings only, and (if necessary) parse strings when you retrieve them via Space.getProperty().

Numbers
parseInt(Space.getProperty("myNumberValue"))
parseFloat(Space.getProperty("myNumberValue"))

Boolean
JSON.parse(Space.getProperty("myBoolValue"))

Thank you for your example scene!

Got it!
many thanks,
.mario