Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by andrewjm10 · Jul 04, 2013 at 02:03 PM · noobunity4support

Script outdated i think, Unity 4 - Compiler errors galore

I got this a while back and it worked before, now i am still a noob(new) but i managed to fix most of the errors. The easy ones where, Random.insideUnitSphere error, just changed it to (UnityEngine.Random.insideUnitSphere) in like every damn script uggh...

Now i have a new error, it seems to be randomly killing the sound too?

 this.tmpPrefab = (GameObject)Resources.Load(DataHolder.Weapon(selection).GetPrefabPath()+DataHolder.Weapon(selection).prefabName, typeof(GameObject));
                 }
                 this.tmpPrefab = (GameObject)EditorGUILayout.ObjectField("Prefab", this.tmpPrefab, typeof(GameObject), GUILayout.Width(pw.mWidth*2));
                 if(this.tmpPrefab) DataHolder.Weapon(selection).prefabName = this.tmpPrefab.name;
                 else DataHolder.Weapon(selection).prefabName = ""

It says: CS0618: `UnityEditor.EditorGUILayout.ObjectField(string, UnityEngine.Object, System.Type, params UnityEngine.GUILayoutOption[])' is obsolete

Comment
Add comment · Show 1
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 Jamora · Jul 04, 2013 at 06:31 PM 0
Share

Do you have the using directive for UnityEngine and/or UnityEditor in the beginning of your scripts? If you do, and you still have to specifically access the namespace it is indeed strange...

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Sjiggle · Jul 04, 2013 at 02:37 PM

You probably need

 this.tmpPrefab = (GameObject)EditorGUILayout.ObjectField("Prefab", this.tmpPrefab, typeof(GameObject), true, GUILayout.Width(pw.mWidth*2));

There's a new parameter introduced a few months ago. This is the link to the documentation on this function: click

The sound problem I don't know, but I guess you should make sure errors do not occur before concluding what influences what.

Comment
Add comment · Show 2 · 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
avatar image andrewjm10 · Jul 04, 2013 at 05:36 PM 0
Share

@ Sjiggle yeah thanks it fixed it, and i was partly right the no sound was because of the script, just not that script lol. I recently added a pause menu script i found it looks like it worked well but now i see it messes up the world sounds :( it sucks, because i got it from here, http://wiki.unity3d.com/index.php?title=Pause$$anonymous$$enu so i thought it would be working 100%

avatar image Sjiggle · Jul 04, 2013 at 10:32 PM 0
Share

Glad to help. I'd appreciate you marking my answer as "the answer" if you feel it answered your problem.

For your sound issue I'd advice posting a new question, since it's a totally different topic.

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

17 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 avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Enter Trigger, display Text, then delete object 1 Answer

Only access door if it's not locked? 1 Answer

Digital Clock: Time.time > 60 2 Answers

Where do I assign GUI scripts? 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