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 /
avatar image
0
Question by pigi5 · Jan 21, 2011 at 11:30 PM · errorbehaviourmissing-reference

Refenced script on this behavior is missing?

I am getting this error twice every time I start my game. It isn't a red error that prevents you from starting, it's grey and doesn't do anything when I click on it. I don't know why it keeps appearing, but my script is not working how I thought it would. It was supposed to draw gui textures (which is working fine) but on the first OnGUI if statement, the rotation is not working how I thought. It is only moving up and down (more diagonally than straight) as I turn my character. The error is:

The refenced script on this Behavior is missing!

I have no idea why this is happening, or why my script is only moving the texture diagonally instead of rotating it around its center like I wanted. For reference purposes, here is my script:

var camera1 : Camera; var camera2 : Camera; var camera3 : Camera; var openButton : Texture2D; var closeButton : Texture2D; var mapMarker : Texture2D; var compass : Texture2D; var mapSkin : GUISkin; var characterTransform : Transform; var screenPos : Vector3; var playerDirection : float; var pivotPoint = Vector2(66.5,386.5);

function Update () { if (camera2.enabled) { screenPos = camera.WorldToScreenPoint (characterTransform.position); } }

function OnGUI() { GUI.skin = mapSkin; if (camera1.enabled) { playerDirection = characterTransform.transform.rotation.y; GUIUtility.RotateAroundPivot(playerDirection,pivotPoint);
GUI.DrawTexture(Rect(1145,3,290,290),compass); GUI.DrawTexture(Rect(1275,133,30,30),mapMarker); if (GUI.Button(new Rect(1115,270,50,50),openButton)) { camera1.enabled = false; camera2.enabled = true; camera3.enabled = false; } } if (camera2.enabled) { GUI.DrawTexture(Rect(screenPos.x - 12,730 - screenPos.y,20,20),mapMarker); if (GUI.Button(new Rect(1250,100,100,100),closeButton)) { camera1.enabled = true; camera2.enabled = false; camera3.enabled = true; } } }

function Start () { camera2.enabled = false; }

Comment
Add comment · Show 4
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 qwertyqaz · Feb 25, 2012 at 12:48 PM 0
Share

I have a similar problem

avatar image Bunny83 · Feb 25, 2012 at 02:46 PM 0
Share

@qwertyqaz: And...? Didn't one of the answers (esp. the accepted) solve your problem? This question was answered over a year ago. This comment doesn't help much...

avatar image Jiia · Sep 19, 2014 at 05:46 PM 0
Share

I just had this problem too but none of the solutions posted here worked.

The problem I faced was that the missing scripts were not visible in the inspector yet they were still somehow attached to the gameobject. What I did was I created a prefab of the broken gameobject, clicked on the prefab and now the empty scripts appeared as components in the inspector. I then deleted all the broken components, removed the original gameobject from the scene and then dragged the prefab back into the scene.

Hopefully this will help someone in the future.

avatar image avi9111 · Mar 13, 2016 at 08:53 PM 0
Share

I packed using my colleagues way and It's the method from unity3.6, so I did not know what setting that I may missed, so cause this problem, any one know about the assetbundle?

16 Replies

· Add your reply
  • Sort: 
avatar image
10
Best Answer

Answer by Steffen Franz · Jan 22, 2011 at 12:00 AM

like it says : one (or more) of your gameobjects in the scene is (are) missing an attached script. Look through your gameobjects in the scene and look for any script that reads None (Mono Script) where the script should be. Delete those or attached the correct script and you get rid of that error message. If you click the error message once it should highlight the gamobject in question in the Hierarchy if I'm not mistaken.

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 Berenger · Mar 07, 2012 at 08:02 PM 1
Share

Sometimes, you can have weird stuff. For instance, with AngryAnts path finding, I sometimes have nodes disappearing, but not destroyed. Once the AngryAnt scripts were deleted, I had that error but the objects didn't show up in the hierarchy. This helped me find the issue.

avatar image liortal · Feb 24, 2015 at 12:20 PM 0
Share

You can use this helper editor script to find all missing references in your project, saves us a ton of time: http://www.tallior.com/fixing-missing-references/

avatar image
9

Answer by unfox · Oct 26, 2012 at 12:09 PM

In my case it was not a game object in the Hierarchy, but its prefab in the Project.

The game object on the scene was ok and contained no attached scripts. Its prefab, however, did contain the script which I had recently deleted.

I found this mistake only by deleting objects one by one in the scene, then checking the log for 'referenced script' warning.

Hope this helps.

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 burtonposey · Mar 21, 2013 at 09:53 AM 0
Share

Pretty much same thing here... i had a prefab that had what I needed on it and never hit "Apply" to get it to update the prefabs that were getting instantiated.

avatar image DanJC · Jun 10, 2013 at 12:12 PM 0
Share

This is what I was missing. $$anonymous$$any thanks.

avatar image
6

Answer by milali · Feb 06, 2012 at 05:54 AM

I fixed this by selecting all (CTRL-A) in the heirachy view and copy then delete.

then click in the scene view and CTRL-A and delete.

then paste (CTRL-V) and all was fixed

Comment
Add comment · Show 3 · 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 reganmusic · Nov 21, 2012 at 01:39 AM 0
Share

This fixed it for me! thanks dude!

avatar image Pawl · Feb 05, 2015 at 05:19 AM 0
Share

Sure enough, this seems to have allowed me to select a ghost object in the scene called 'BreadCrumbs' and delete it. Printed the following message, but it worked!

"Cleaning up leaked objects in scene since no game object, component or manager is referencing them. $$anonymous$$onoScript has been leaked 1 times."

avatar image kaybee99 · Nov 05, 2015 at 08:14 AM 0
Share

Fixed! I've been reading answers telling me the problem must be to do with deleted scripts, yet I haven't removed anything! Thank you so much

avatar image
1

Answer by Nomibuilder · Dec 18, 2014 at 07:55 AM

Make a prefab of that gameObject which has missing script. And then click on the prefab. You will find them. Remove those missing scripts and apply that prefab in Heirarchy and remove the previous One. This is how I got rid of this problem

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 Sorenzo · Apr 15, 2015 at 07:59 AM 1
Share

thanks it helped :)

avatar image Nomibuilder · Apr 15, 2015 at 08:00 AM 1
Share

You are welcome.

avatar image
1

Answer by sathyaalias · Jul 21, 2015 at 11:42 AM

In one case, I had created a script with a misspelled name (Ex: PLayerCtrl - with a uppercase L) and the C# Class is named such. I corrected the script name within the editor to 'PlayerCtrl', the file name had changed, but still the Class name was the old 'PLayerCtrl'.

Naturally fixing the class name fixed this error. Hope this will help someone. Thanks.

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
  • 1
  • 2
  • 3
  • 4
  • ›

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

27 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

Related Questions

The referenced script on this Behaviour is missing! 4 Answers

Easy explosion script 1 Answer

The referenced script on this Behaviour is missing! 0 Answers

The referenced script on this Behaviour is missing! please help me 1 Answer

Error: Reference on this Behavior is Missing. 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