Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 $$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
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 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
0
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
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

28 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

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

Unity Editor very slow using graphics processor Nvidia GeForce GTX 1060 1 Answer

Scene view visual glitch, multiplying objects (like WindowsXP bug) 1 Answer

Unity hangs when opening a project. 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