How to use JSONUtility.FromJSON

The documentation on the function is absolute garbage and I’ve spent way too much time trying to figure it out.

How do you use JSONUtility.FromJSON ? A simple example would be perfect.

I can’t make the example in the docs much simpler :frowning:

// you have json data with a string, int and a float with keys
// name, lives and health
// {"name":"Dr Charles","lives":3,"health":0.8}

//you have a class with variables whose names match the
// the json key's and types matching their json values

public string name;
public int lives;
public float health;

 JsonUtility.FromJson<PlayerInfo>(jsonString);

FromJson should return an instance of PlayerInfo with variables set from the json