Run cloud script from Untiy


How can I run cloud script from Unity?
I’m trying do something like this:

public void CreateCharacter(string nickname) {
var request = new RunScriptRequestDesc("CREATE_NEW_CHARACTER");
request.Params.Add("nickname", nickname);
	(scriptRequest, response) => { OnCharacterCreated?.Invoke(); },
	(scriptRequest, error) => {


I’m getthing following error message:
NullReferenceException: Object reference not set to an instance of an object
in line
request.Params.Add("nickname", nickname);


I havent tried your specific example, but I believe it is when trying to do request.Params.Add(). Params is null until set. Usually I see building a dictionary of params, then set it request.Params = myParams;

It’s a little old, but there’s an example of this in one of our sample projects: