How I can create System.Guid in Unity?

So basiclly i need somehow to create Guid but Unity doesn’t creating it.

code looks like this

private Guid _id;

private void Awake()
{
    _id = new Guid();
}

And its creating only this Guid:
8231052--1075572--upload_2022-6-24_22-29-50.png

Have you tried:

_id = Guid.NewGuid();
2 Likes

Did you try this? It’s the second Google result of “Unity guid”

1 Like

This seems to work

But is Guid Serializable in Unity? Cuz it seems to be empty json string when I serialize this created Guid. Im using JsonUtility by Unity
8231109--1075575--upload_2022-6-24_23-5-55.png

Again, something extremely easy to find the result to with a search engine. Here’s a link to a thread about it.

https://answers.unity.com/questions/340997/unity-doesnt-store-guid-field.html

The answer is no.

1 Like

Yes, I just ToString() this Guid and store this as string, Thanks for help!