Sign In Register

How can we help you today?

Start a new topic
Answered

Spark.getData().nextPlayer is undefined

How am I supposed to get next player in a turn-based challenge to consume turn?


Spark.getData().nextPlayer is undefined when I use it in ChallengeStarted message Cloud Code.


Best Answer

Hi Roman,


You are accessing this value slightly incorrectly here. The following should work for you.

 

var nextPlayer = Spark.getData().challenge.nextPlayer

 

Try that and let me know if you have any further questions.


Regards,

Liam

1 Comment

Answer

Hi Roman,


You are accessing this value slightly incorrectly here. The following should work for you.

 

var nextPlayer = Spark.getData().challenge.nextPlayer

 

Try that and let me know if you have any further questions.


Regards,

Liam

Login to post a comment