Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
  • Help Room /
avatar image
0
Question by Cheef · Jul 02, 2017 at 02:04 PM · scripting problemcrashbuild-error

Missing script after build, but no referenced gameobject in scene.

Hi all!

I have been building a VR thingy... :) I was using the Playway Water system for it. The project actually doesn't even need water in it, but I used it just because it looks so darn nice.

After I tested to build the project, it gave me some weird shader errors (related to the playway water) in the output log. And because the water is not necessary, I decided to delete the plugin and check if it builds correctly without it.

Now I get this error in the output_log after it crashes on start:

(Filename: Line: 381) The referenced script on this Behaviour (Game Object 'PlayWay Water Spectrum Sampler') is missing! (Filename: Line: 1754) Crash!!!

It says that a script is missing from a gameobject called 'PlayWay Water Spectrum Sampler'. (..right?) It just happens to be that there is no such gameobject in the scene/project.. I don't think there even has been..?

I already posted a question to the assets own forum, but I'm starting to think this might be something that's not directly related to the water system.

If anyone has some ideas, or this has happened to someone, I could surely use some help..

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Wiki

Answer by Quatum1000 · Aug 21, 2017 at 12:17 AM

2017.1.0bxxx Referenced Script on this Behaviour Missing. But its not visible to remove.

Short Term : I'm a pro user from Unity version 5 and I work the latest possible 2017 version that has enabled the dark pro skin. Later versions than 2017.1.0b10 doesn't except the pro U5 registration and show the light UI.

However. If a component was deleted, or the class was renamed during any reason (by script or manually or outside of Unity) and you go into play mode and stop. Then you get the Referenced Script on this Behaviour Missing info. BUT the inspector didn't show the missing component on the GameObject. So your not able to remove the component! The warning stays for ever, or you have to delete the GameObject. There are some wiki scripts in this case of this issue, but they all don't work, because it's not possible to remove a component by script it's already null.

I found a solution to make the component on the game object visible, and the curiosity is, unity show a shadow reference for this missing component for one time at the GameObject. Means, if the scripts does not exist any more in unity, you can see what scripts it was and it's properties too. I tried this several times with new projects an it works always in 2017.1xx.

Make a backup of your project to be assured nothing goes wrong.

How to: Save this script in an Editor folder. Read the steps exactly and follow them.

alt text

 using UnityEngine;
 using UnityEditor;
 public class FindMissingScriptsRecursively : EditorWindow {
     static int go_count = 0, components_count = 0, missing_count = 0;
 
     [MenuItem("Window/FindMissingScriptsRecursively")]
     public static void ShowWindow() {
         EditorWindow.GetWindow(typeof(FindMissingScriptsRecursively));
     }
 
     public void OnGUI() {
 
         GUILayout.Label("1) Select ALL GameObject in the Hierarchy.");
         GUILayout.Label("2) Click Button [Find Missing Scripts...]");
         
         if (GUILayout.Button("Find Missing Scripts in selected GameObjects")) {
             FindInSelected();
         }
         GUILayout.Label("3) Read the result in Console.");
         GUILayout.Label("4) Open this script with Mono or VS.");
         GUILayout.Label("5) Select the GameObject where missing scripts occur.");
         GUILayout.Label("6) Edit and Undo any line in FindMissingScriptsRecursively script and save the script");
         GUILayout.Label("7) Click back onto the Unity Editor and let recompile the FindMissingScriptsRecursively script.");
         GUILayout.Label("8) Now the missing component on the gameobject is now visible for deteltion.");
         GUILayout.Label("9) Repeat this procedure for each missing script/component.");
 
     }
     private static void FindInSelected() {
         GameObject[] go = Selection.gameObjects;
         go_count = 0;
         components_count = 0;
         missing_count = 0;
         foreach (GameObject g in go) {
             FindInGO(g);
         }
         Debug.Log(string.Format("Searched {0} GameObjects, {1} components, found {2} missing", go_count, components_count, missing_count));
     }
 
     private static void FindInGO(GameObject g) {
         go_count++;
         Component[] components = g.GetComponents<Component>();
         for (int i = 0; i < components.Length; i++) {
             components_count++;
             if (components[i] == null) {
             missing_count++;
                 string s = g.name;
                 Transform t = g.transform;
                 while (t.parent != null) {
                     s = t.parent.name + "/" + s;
                     t = t.parent;
                 }
                 Debug.Log(s + " has an empty script attached in position: " + i, g);
             }
         }
         // Now recurse through each child GO (if there are any):
         foreach (Transform childT in g.transform) {
             //Debug.Log("Searching " + childT.name  + " " );
             FindInGO(childT.gameObject);
         }
     }
 }





 






untitled-1.png (137.8 kB)
Comment
Add comment · Show 1 · 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 NV3-Developer · Aug 21, 2017 at 02:05 PM 0
Share

$$anonymous$$ust repeat the procedure for every missing component, but works. Thank you, you made my day!!

avatar image
0

Answer by N3V_Rigg · Aug 24, 2017 at 11:57 AM

Haven't the playway water asset, but now found all game objects having missed and invisible components. Finding all assets are hidden in the scene without selecting should b possible too. @Quatum1000

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

150 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 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 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 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 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 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 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 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 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

Working in Editor, but not in a Build 0 Answers

Program Crash 1 Answer

Unity just started crashing. 0 Answers

The type or namespace name `Input' does not exist in the namespace `UnityEngine.XR.WSA'. Are you missing an assembly reference? 0 Answers

No Monobehaviour scripts in the file 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