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 /
avatar image
0
Question by Bryangs · Jan 04, 2017 at 02:17 AM · buildspritesui imagemissingafter

Sprites missing on build

Hey guys, this is a really really annoying thing that has been questioned before, but as far as i know, none of the questions have an answer that solves the problem. I am making an FPS, and it is almost finished. I am talking about 2 weeks of work, and i am very frustrated by this minor problem that is basically ruining my project. In my game, i always have two Canvas. The standard canvas that show some images and a timer, and what i conveniently named "Sub-Canvas" for my character, that display health and ammo. My problem is that after building the game, both canvas basically don't work. The sprites became square and purple (missing material). What am i supposed to do? I've searched a LOT and found only things like layer order and script order but this really don't work. What do i do? I can't play with those purple things on the screen, and it is very disorienting and "Unplayable".

Comment
Add comment · Show 22
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 Bryangs · Jan 04, 2017 at 02:18 AM 0
Share

Btw it runs fine in the editor, it only happens in the build. Dragging them into the scene as objects also work, so the problem is with the canvas!

avatar image losingisfun · Jan 04, 2017 at 02:23 AM 0
Share

Is it only happening when you build? or does it also happen in game display within Unity? also, how are you loading the Sprites onto the Image components? Are you dropping and dragging them through the inspector? or are you loading them another way?

(You should show us some Code)

avatar image Bryangs losingisfun · Jan 04, 2017 at 02:36 AM 0
Share

@losingisfun Only when you build, and just dragging them. I have some scripts related to a slider and a text, but this doesn't apply at all to the images.

avatar image losingisfun Bryangs · Jan 04, 2017 at 02:43 AM 0
Share

This may sound obvious, but are your sprites located somewhere within the Assets folder? because anything outside that folder doesn't go into the build (I don't think)

Show more comments
avatar image tkamruzzaman · Jan 04, 2017 at 02:44 AM 0
Share

Are you using custom shaders ? Does these shaders support your build target ?

avatar image Bryangs tkamruzzaman · Jan 04, 2017 at 02:53 AM 0
Share

No, no custom shaders

avatar image losingisfun · Jan 04, 2017 at 02:55 AM 0
Share

I would try to create a new project and replicate JUST the canvas that you are trying to use. Use the same scripts, and then you can try to debug it in a control

avatar image Bryangs losingisfun · Jan 04, 2017 at 03:00 AM 0
Share

Going to try, but as i said, i don't have any script that uses the images themselves.

avatar image Bryangs Bryangs · Jan 04, 2017 at 03:04 AM 0
Share

Sadly, they actually work on the new project.

Show more comments
avatar image Bryangs · Jan 04, 2017 at 03:06 AM 0
Share

Yeah, but how can i know what is the problem now? $$anonymous$$ i think. Oh man this is going to take a life...

avatar image losingisfun Bryangs · Jan 04, 2017 at 03:07 AM 0
Share

just keep trying to replicate it identically. Even folder names. You could have named one particular folder with a symbol that it doesn't like. Who knows

avatar image Bryangs losingisfun · Jan 04, 2017 at 03:17 AM 0
Share

This doesn't help me at all, i would take AGES to discover the issue IF i discovered, and i really need to release this game as soon as possible =C

Show more comments
Show more comments

1 Reply

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

Answer by Bryangs · Jan 04, 2017 at 07:46 PM

I found an answer for it. Finally... At least i hope this answer will help someone, because i know that someone will have this problem in the future, like a lot of people did in the past.

In the end, i didn't discovered what was the cause of the bug, and as i can't configure the build i can't know why is it happening, but i tried this, and it might help you, who knows:

1- Creating and moving the images to a folder named "Resources". 2- Reimporting the Images. 3- Deleting and creating another Canvas. 4- Dragging the Images to the screen as GameObjects and making another build. 5- Trying with other images. 6- Unninstalling and Reinstalling Unity. 7- Adding ui shaders to exceptions (always load). 8- Changing script order. 9- Adding shaders to load on start.

If none of these work, and they probaly won't, this fixed my problem:

Create a material for every sprite you are having this bug, and add the image to it. Then change the material's shader to UNLIT > TRANSPARENT. Then, in your canvas, apply each material to it's image. For some reason, after building the project, these materials will not be deleted. This is a quick fix, but of course i am still having problems with texts and it's just annoying to use one material to each image, but that's the only thing that worked.

I sincerely hope this will NEVER happen to you.

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

67 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

Related Questions

Distribute terrain in zones 3 Answers

Image renderer stretching sliced images 1 Answer

Blank result from build and run 3 Answers

Circular 9 slice? Draw a circle with constant thickness 1 Answer

No Windows Build Support? 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