Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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
4
Question by hiflyer380 · Sep 07, 2015 at 07:52 AM · 2dspriterenderingscenegame view

[SOLVED] Sprite showing up in "Scene", but not in "Game"

Before I begin: I've already tried everything already on the forums with relation to the Z axis, and that hasn't worked, so please avoid answering with that as a solution.

With that in mind, my problem is more or less the same - a sprite shows up in the "Scene" view, but not in the game, and, for the life of me, I can't figure out what's wrong. Screenshot link below.

Note: everything is on the canvas, and the canvas is set to Screen Space - Overlay, so it shows up on camera.

Due to the two screenshot limit, I've linked to them here.

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 CaptainKirby · Sep 07, 2015 at 08:45 AM 0
Share

Did you try and change it's order in layer? Otherwise I am thinking it could be a camera setting, are you using perp or ortho?

avatar image hiflyer380 · Sep 07, 2015 at 04:47 PM 0
Share

@Captain$$anonymous$$irby: The camera is in orthographic mode.

11 Replies

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

Answer by hiflyer380 · Sep 08, 2015 at 04:39 AM

Got it! I set the canvas to Screen Space - Camera, and set the Render Camera to Main Camera. Also, I created a small 1 pixel by 1 pixel black square to use as my camera icon so it doesn't block my view.

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 HanSoloYolo · Mar 24, 2018 at 06:33 PM 0
Share

CONFIR$$anonymous$$ED! Worked for me! Thank you!

avatar image Willard720 · Apr 27, 2018 at 08:14 PM 0
Share

Except now all of my UI elements are missing in the Scene View but visible in the Game View (exact opposite problem). Oh Unity.

avatar image TechnoStew · Jul 11, 2018 at 03:36 PM 0
Share

Hey there, do you think you could elaborate on what you mean by "set the Render Camera to $$anonymous$$ain Camera?" I'm having an issue where literally every sprite is invisible in my Game Tab.

avatar image TechnoStew TechnoStew · Jul 11, 2018 at 04:40 PM 0
Share

Oh my god. For some reason, when my character loaded in, his Z position was 90. The level's Z position was 0, so the camera was physically behind the level. Whoops.

avatar image $$anonymous$$ · Sep 08, 2018 at 01:30 PM 0
Share

perfect work! Thank you.

avatar image talhakammybond · Aug 13, 2019 at 02:06 AM 0
Share

Thanks! I fixed it by setting the camera.

Show more comments
avatar image
2

Answer by davisj16usmc · Sep 08, 2015 at 02:03 AM

@hiflyer380 Take a screen and post it; your problem may be with the X and Y positions. GUI objects use a position base between 0 and 1. It's the biggest problem with 2D objects in Unity in my opinion. You should use Screen.Width and Screen.Height to place your sprites, text, and other 2D objects in the scene so they remain visible in all resolutions. Also ensure you're not designing in Free Aspect; use a ratio like 16:9 or 4:3 to design so you know they'll at least be visible in the game.

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
2

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 · Show 2 · 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 retxab · Dec 08, 2017 at 10:53 PM 0
Share

Just had this issue. Was this exactly. Thanks a ton!

avatar image haveamission · Oct 08, 2020 at 08:50 PM 0
Share

Yep, this was my issue. I switched to 3D mode, and my Z value was like -100 something. I was wondering why I was able to collide with the objects in 2D mode, but couldn't see them

avatar image
2

Answer by HernandoNJ · Mar 18, 2020 at 07:42 PM

I shouldn't change Canvas camera settings because of my code. I tried changing layers, didn't work. I figured out that axis Z was -456.7297 so, I changed it to 0 and it worked ok.

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 davisj16usmc · Sep 08, 2015 at 02:05 AM

Just tested because I'm used to Unity 4; here's the result:

alt text alt text

As you can see it worked; Sprites use a different position system than canvas objects. Don't attach your sprite to the canvas; set it's position to -8 on the z axis, and switch your canvas to world space and move it back until everything looks the way it should again. You can usually just move it back and alter the scale. That usually does the trick. Always remember how the camera views things; even in 2D games it uses the z axis to set depth of objects. Things closer to the camera will appear on top of things further away. In my case the a and b images are ui images and the x is a sprite. All three are set as sprites in the texture settings.


sprite1.jpg (165.5 kB)
sprite2.jpg (58.4 kB)
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
  • 1
  • 2
  • 3
  • ›

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

21 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

Related Questions

Sprite not visible from behind 0 Answers

2D scene level design Help 2 Answers

Making transparent sprite render as quad 1 Answer

2D Sprite Graphics Glitching, Skewing, Flickering, Crazy, Haywire 1 Answer

Using 2D sprites in a 3D environment 2 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