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 Crixu · Oct 25, 2015 at 05:01 PM · unity 5sprite

Sprite background

Sprite is visible in the scene, but not in a build or in game view. Tried sorting layers etc. changing position, rotation, scale. Nothing worked so far. Alpha isn't affected at all during play mode.

Any ideas?

Comment
Add comment · Show 2
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 Crixu · Oct 25, 2015 at 07:35 PM 0
Share

Screenshot

Here's a screenshot of the inspector. No script is referencing to this sprite. No settings have been changed in the main camera and there is no other camera.

avatar image Crixu Crixu · Oct 26, 2015 at 05:08 PM 0
Share

Any ideas?

2 Replies

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

Answer by Crixu · Oct 26, 2015 at 06:04 PM

The problem was the Z position. By resetting the position of the sprite (or just the Z position) it worked out for me.

The thing I probably did wrong was setting the sprite as a child of the camera and then resetting the position etc. This changed the Z position to the exact same as the camera, clipping it through the "lens" (near clipping plane).

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 Statement · Oct 25, 2015 at 05:37 PM

Does it (or any parent) have the tag EditorOnly? It will strip it out of the build.

Or, perhaps some piece of code is turning it off, setting alpha to zero or otherwise moving the sprite when you hit play.

If it's far out, perhaps it's outside the cameras clipping planes.

Comment
Add comment · Show 7 · 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 Crixu · Oct 25, 2015 at 06:35 PM 0
Share

As far as I know I haven't used EditorOnly at all, and in the code I've applied to the background I don't change that alpha or anything at all. Pausing play mode and looking at scene view still shows the background with the camera focused on it. Camera has Z -10 and the background at Z 0.

Also, it's a 2D game so it's an orthographic camera.

avatar image Statement Crixu · Oct 25, 2015 at 06:57 PM 1
Share

Orthographic cameras still have clipping planes.

avatar image Crixu Statement · Oct 25, 2015 at 07:14 PM 0
Share

I know, but it might be worth mentioning ;)

Is there something I could've overlooked perhaps?

Show more comments
avatar image Statement Crixu · Oct 26, 2015 at 05:45 PM 1
Share

Your background is at z -10 which is the default position for a camera in Unity. It would be clipped if you kept it there and if you haven't moved your camera. Try setting z to 0 and see if it pops into view.

Otherwise I don't know if it's a far fetch, but try turning off occlusion culling if you had it on. I dont know if it affect sprites.

avatar image Crixu Statement · Oct 26, 2015 at 05:52 PM 0
Share

Thank you, it works now!

Show more comments

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Unity 2D Sprite Blurred 2 Answers

How to convert a c# code to unity 1 Answer

How do i make character eyes blink after some seconds have passed? (on 2D sprite) 1 Answer

Unity NullReferenceException on Sprite import 0 Answers

[NOOB] Unity pixel per Unit? 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