Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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 /
avatar image
9
Question by ChloeUnrau · Jan 06, 2014 at 04:59 AM · spritespritesinvisibledisappear4.3

Sprites Become Invisible (SOLVED)

I'm a beginner, and I'm making a 2D pong game in Unity 4.3. Yesterday, all of my sprites were displaying properly, but today I open up the project to find that some of my sprites had turned invisible.

They still exist, and I can see the wireframe when I click them, but they are not visible in scene view or in the game, even when it runs. As you can see from the pictures, one of the paddles, and one of the score barriers are invisible.

alt text

alt text

If I duplicate one of the invisible sprites, the duplicate is visible, but then another sprite turns invisible. All of those sprites, save the background and the camera, are on the same layer. I have restarted Unity and restarted my PC to no avail.

Can anyone tell me what's going on here? Is this a bug, or did I possibly set something up wrong?

Thanks in advance :)

screenshot1.png (217.4 kB)
screenshot2.png (235.0 kB)
Comment
Add comment · Show 7
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 Invertex · Jan 06, 2014 at 05:28 AM 0
Share

What happens if you drag the Player prefab from your Sprites folder into the scene viewport, does it display fine? You don't appear to actually be using the prefabs, since the objects in your scene have black text and no (Select/Apply/Revert) at the top of their attribute window. The Hierarchy text should be Blue when you're using the prefab version.

avatar image ChloeUnrau · Jan 06, 2014 at 06:02 AM 0
Share

Invertex, there are no prefabs. I don't even know what those do yet :S

avatar image Invertex · Jan 06, 2014 at 06:34 AM 1
Share

Ah right, I see you only have sprites. Alright, well, I would say to just delete the object and drag the sprite back into your scene, and attach the script you have for it again. Does that work? I would look into what prefabs are and how you use them. To put it simply, you drag an object from the scene Hierarchy into your project folder, and you create a prefab of that object which exists outside the scene, and can be modified to affect the one in the scene.

avatar image ChloeUnrau · Jan 06, 2014 at 07:04 AM 1
Share

Yup, that fixed it! Thank you so much, Invertex, you just saved my day :)

So what was happening there? Should I always ensure none of my Sprites are on the Default sorting layer? Why is that bad?

avatar image ChloeUnrau · Jan 06, 2014 at 07:40 AM 2
Share

Awesome, that makes perfect sense. At first I found it odd that bottom layers are rendered on top of top layers (as opposed to Photoshop), but when I thought about it a bit more, I realised it's not following visual logic, but code logic. Code executes from top to bottom, so it makes sense that the later things are rendered, the more on-top they are.

Thanks again :)

Show more comments

4 Replies

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

Answer by Invertex · Jan 06, 2014 at 06:58 AM

I see that your SortingLayer in your SpriteRenderer is set to default, try changing it, that's the layer system that determines render order for sprites. As it seems like this is a render order issue.

Comment
Add comment · Show 5 · 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 ChloeUnrau · Jan 06, 2014 at 07:49 AM 0
Share

This solves the issue :)

avatar image TempestMia · Apr 25, 2015 at 09:26 PM 0
Share

That helped me out too. For some reason, when I was working on my project last night, everything was showing up fine. Open Unity this morning, Sprite is hidden. No change in code, nothing. Well, sure enough, I changed the order and that fixed that.

avatar image 1singur · Dec 08, 2015 at 07:59 PM 0
Share

How do you modify the order, though? I can see the "order in layer" field. I suppose higher numbers give priority? Like if I have a background, a middle and a foreground layer, do I give background elements a 0 value, the middle gets a 1 and foregrounds a 2? Or is it the other way around?

alt text

screenshot-08-dec-15-09-50-03-pm.png (4.9 kB)
avatar image Invertex 1singur · Dec 08, 2015 at 10:18 PM 1
Share

@1singur Yes that is how you modify the render order of the sprites. I don't recall whether it's a higher or lower number that's rendered first, as it's been a while since I used the system, so just test it out and see! :)

You can also create sorting layers to group together types of sprites, like all background related sprites in one render layer, and mid-ground in another. So everything in the background layer will always render behind the mid-ground sprites, regardless of "Order in Layer", as that order only affects sprites within a given layer.

avatar image Shippety · Nov 10, 2016 at 02:05 AM 0
Share

Thanks, that helped me out too! Such a simple issue, hahah- glad there's also a simple solution.

avatar image
1

Answer by WhiteCastle · Sep 26, 2017 at 05:08 PM

In case anyone else come across this, I had a similar issue. I was in 2D mode and my sprite was rotated such that it was perpendicular to the camera, thus invisible. It is really obvious if you swap to 3D mode.

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
avatar image
1

Answer by monark · Apr 10, 2021 at 03:23 PM

If you are using URP don't get caught out by the same thing I did. In my Forward renderer data I had removed the UI layer from the transparent layer mask. This doesn't affect the rendering of the UI in game, but in the editor scene view it means no sprites are rendered, including the UI for no obvious reason....

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 ThomasKang · Jan 13 at 08:31 PM 0
Share

Ah, the new layer I made was missing from my Forward Renderer Data!

avatar image
0

Answer by thehuhuboy31 · Oct 19, 2020 at 09:25 PM

Alright, The same problem occurred to me when i relaunched my project. everything was invisible but the background was just present. After thinking about it i moved the background just to see and my project was present there. So the solution i found was to remove like delete the existing background and take up the same but from the assets again in order for your project to be back on top.

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

26 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

Related Questions

Is it possible to animate a sprite on a 3d mesh? 0 Answers

Why is my sprite disappearing when I make a new material and add the Sprites-Default shader? 1 Answer

How to add floating bounce effect to sprite? 1 Answer

How to call sprite at run time 3 Answers

iOS Sprites in PVRTC? 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