[Tutorial] Generating Unique ID's in Unity3D

Hi everyone, I’ve been doing a bit of writing lately to stay focused and get ideas on paper whenever I get stuck. As I like to use Unity regularly I thought I’d try and write a few pieces here and there to help people who are new to programming and Unity in general.

I thought I’d start out with something simple and provide some code I use to generate random alpha-numeric strings in my projects. I go through and explain how the code works if beginners wish to look at it and work out how the code matches up to the description. I’m sure this will likely be common knowledge to a lot of people but looking to help where I can. Any feedback would also be greatly appreciated so that I can improve on it for next time.

Unity3D Unique Identification Strings

Thanks! I’ve disabled comments on the website because it is prone to spam but happy to reply to any comments here.

Well, whats about System.Guid.NewGuid().ToString() this guarantees a 128bit value (displayed as string) which is guaranteed to be almost unique (the chance of a collision is 2^122 : 1).