Sign In Register

How can we help you today?

Start a new topic

CreateMatch / CreateMatchById always returning null

I created an event to start matches, but for some reason the SparkMultiplayer function CreateMatch / CreateMatchById always return null instead of a match ID. Also there is no object stored in the matchInstance or pendingMatch collections.

According to this thread https://support.gamesparks.net/support/discussions/topics/1000084249

I should find something in the matchInstance collection


The playerid i use is definitely valid, but i get no error whatsoever


var player = Spark.getPlayer();


//var players = Spark.find("player", {})
var players = [player.getPlayerId()];

var match_id = Spark.getMultiplayer().createMatchById(players);

Spark.setScriptData("gameID", match_id);
Spark.setScriptData("player1", players[0]);

 Also if i use the find function I get no results for some reason.

The returned field gameID is always null and the field player1 returns my valid playeriD



Login to post a comment