• 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
Question by $$anonymous$$ · Sep 15, 2015 at 06:55 PM · editorbugnullreferenceexceptionbug-perhapsmissing script

UnityEngine.UI.Image keeps removing itself from a Prefab.

I have a really weird problem and it seems to happen randomly (or whenever I close + open Unity.) I am running Unity 5.0.2f1 and it seems to do it when I close off of unity.... I am saving the prefab and the scene so there shouldn't be a problem. When I do get the problem, my other main scripts relay on that image script being there so when it disappears, nothing works.

What it seems to do it sort of remove it self so I get "Missing Script" errors. Any suggestions? (I am updating Unity but where I live, the internet is fairly slow (0.1mbps up / 1mbps down) so I don't really want to update.)

Comment

People who like this

0 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 kjakubison · Sep 15, 2015 at 07:01 PM 0
Share

I've seen this happen on Animations and such that are imported. Have you tried to recreate or duplicate your asset to see if this changes anything?

avatar image $$anonymous$$ kjakubison · Sep 15, 2015 at 07:21 PM 0
Share

Yes. I have another very similar prefab and it has done the same thing.

avatar image kjakubison $$anonymous$$ · Sep 15, 2015 at 07:32 PM 0
Share

Did you copy those GameObjects over from another Project that you were using or were they freshly created in your current project? I have noticed some issues with copying objects over from different projects as well.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by $$anonymous$$ · Sep 15, 2015 at 08:01 PM

@kjakubison It's okay for I have thought of a slightly hacky solution!

 public Sprite mySprite; //Or something like that...
 
 void Awake()
 {
     gameObject.AddComponent<UnityEngine.UI.Image>();
     gameObject.GetComponent<UnityEngine.UI.Image>().sprite = mySprite;
 
     //Just for my purposes
     gameObject.GetComponent<UnityEngine.UI.Image>().enabled = false;
 }
Comment

People who like this

0 Show 0 · 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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

Error when trying to upload a package to the unity asset store (file not found, loader.html) 2 Answers

Strange Memory Leak in Unity Editor 0 Answers

Got a weird editor issue with C# scripts: They won't open correctly 1 Answer

Mouse graphic glitch in Game tab 2 Answers

How can I get transparent background when using Mixed Reality Remoting / Holographic Remoting Player with Mixed Reality Capture (MRC)? 0 Answers


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