Answer the question
In order to leave comments, you need to log in
From JSON to object does not work, what should I do?
The code doesn't work :((
There is a class
public class Player : MonoBehaviour
{
public int[] levels = new int[3] {1,0,0};
}
Player player = new Player();
string str = JsonUtility.ToJson(player);
player = JsonUtility.FromJson<Player>(str);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question