• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by kalvinlyle · Apr 29, 2012 at 10:48 PM · iosguiduuid

How can I generate a GUID or a UUID from within Unity

Do we use GUID ?

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · Apr 15, 2013 at 06:42 AM 0
Share

for future readers, Unity does all this work for you ...

http://answers.unity3d.com/questions/373055/deviceuniqueidentifier-curiosity-.html

avatar image ina · Aug 17, 2013 at 08:08 AM 1
Share

This guy is not looking at device UUID but just a UUID string in general as a key to use in a data structure schema

avatar image Fattie · Aug 17, 2013 at 08:23 AM 0
Share

True, but it's a bad idea :) it's like asking about generators when all you need is Invoke. Or program$$anonymous$$g physics by hand in Unity, ins$$anonymous$$d of using PhysX.

As I said, for future readers the fact is you just use the amazing function Unity has built-in for this purpose. The scheme presented below (of using the five "random" items) is appalling program$$anonymous$$g on many levels. If you have a job and did that you'd just be fired (well certainly by me anyways! :) )

avatar image matronator Fattie · May 30 at 09:41 PM 0
Share

No it's not the same. He didn't say he wants the unique device ID, so don't jump to conclusions. What if he needs multiple GUIDs for different purposes on a single device? Then your approach is kinda useless, since the ID will always be the same per device.

avatar image komodor · Nov 29, 2016 at 05:10 PM 1
Share

working with you Fattie must be really fun :D guy who doesn't read specs and then fire random guy ... ROFL

btw ... we've made our proper physics engine :D the one in unity can't do stuff we needed

1 Reply

· Add your reply
  • Sort: 
avatar image
20

Answer by Bunny83 · May 06, 2012 at 03:10 AM

According to [Mono Compatibility page][1] Guid is fully supported on all platforms / Mono versions.

It's:

 System.Guid.NewGuid();


So in C# you would do something like:

 System.Guid myGUID = System.Guid.NewGuid();


Usually you want:

 string newBackstageItemID = System.Guid.NewGuid().ToString();


(Like poday mentioned, if you use the micro mscorlib the Guid class is not included and you have to use a custom way to build a pseudo Guid.)



[1]: http://unity3d.com/support/documentation/ScriptReference/MonoCompatibility

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Lightmapping not appear on iOS build 0 Answers

Json . NET, iOS and AOT 1 Answer

unity5 cannot build to device XCODE iOS 0 Answers

Is it possible to send SMS from an action in Unity? (Mobile iOS or Android) 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges