var chalId = Spark.getData().challenge.challengeId;
var moves = new Array(5);
moves[0] = new Array();
moves[1] = new Array();
moves[2] = new Array();
moves[3] = new Array();
moves[4] = new Array();
Spark.getChallenge(chalId).setScriptData("moves", moves);
The problem is that there are no string indexing the data I am trying to retrieve. Is there a way around? Or must I set a string as an index name for each array in the array "moves"? If so, how can I do?
1 Comment
A
Andrea Marchetti
said
over 5 years ago
Pardon.
This is the correct way to insert array data:
var moves = ({
"player" : new Array(),
"posX" : new Array(),
"posY" : new Array(),
"dirX" : new Array(),
"dirY" : new Array()
});
Andrea Marchetti
Hello,
This is how I create the data.
This is how I upload the data:
This is the data in the database:
This is my code in Unity to retrieve data:
The problem is that there are no string indexing the data I am trying to retrieve. Is there a way around? Or must I set a string as an index name for each array in the array "moves"? If so, how can I do?