Sorry I'm new to both C# and Godot.
I want to save the player's position in file. I use JsonSerializer.Serialize to convert struct into string.
struct Player {
public string name { get; set; }
public Vector2I position { get; set; }
}
name can be serialized correctly, but position can't.
So how can I store Vector2 in file ?
Or should split position into X and Y ?
I know it works, but it's really cumbersome, it's the last approach I want to use.