Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 chillypacman · Dec 11, 2011 at 02:24 AM · depth-buffer

Player face dissapears behind another mesh rendering behind it?

In this demo: http://www.jabberworx.net/cellgame/cellgame.html you can see a character sprite with a red face. If you press the down and right arrow on your keyboard when the game loads up and run it you'll notice the players face will disappear after it reaches a certain point.

The player face is a child of the body and its z position is offset by -0.05f of the body, I've checked and have found in terms of z coordinates it's always in front of the body, yet it still disappears behind the body.

Any ideas why this is happening and how I could fix it? I'd like to keep rendering in perspective view though, I know orthographic rendering would probably fix this.

Comment
Add comment · Show 1
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 Dakwamine · Dec 11, 2011 at 02:01 PM 0
Share

Can you show us a screenshot of the Scene View while playing in Unity and while the face is placed behind the sprite ? (please select your two objects to see the gizmos)

And is the face a tk2d sprite like the white body ?

And what if you add a little script which will force child's Z-position (absolute or relative to its parent) ?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Dec 11, 2011 at 03:47 AM

How do you render your "body" and what is it actually? Also a 2D sprite? Do you use a sprite engine like SpriteManager2 or something like that? If it's a billboard sprite it will always be rotated towards the camera. When you move to the right side from the screen center the body sprite will be tilted. If your face-sprite stays in the moving-plane (even when offset by 0.05) the body will hide the face sprite at a certain angle. If you look in the other direction (move the face sprite to the other side it's visible again)

Comment
Add comment · Show 3 · 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 chillypacman · Dec 11, 2011 at 04:19 AM 0
Share

I'm using tk2d (toolkit 2D) to do the sprites, they're not billboarding or rotating on their own (rotations are frozen).

avatar image Bunny83 · Dec 11, 2011 at 04:58 AM 0
Share

Are you sure? Billboarding sprites would totally match the effect. Its the same radial around the screen center. Have you checked the rotations of all relevant objects (so the object itself and all of it's parents) when you move close to an edge?

I haven't used toolkit 2D yet so i can't say much about that.

avatar image chillypacman · Dec 11, 2011 at 05:13 AM 0
Share

It's not billboarding, like I said, there are no rotations at all besides on the z axis, I also know as a matter of fact the sprites don't billboard from manually moving around the camera in-game.

avatar image
0

Answer by solidd_swa · Nov 17, 2012 at 10:55 PM

I am having the same issue with 2D tool kit, did you manage to solve this?

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 chillypacman · Nov 18, 2012 at 04:49 AM 0
Share

It's a limitation of Unity, apparently it's difficult to render multiple transparent objects so unity doesn't get very granular with the sorting.

You can get past this by rendering using two seperate cameras, one for the body and then the next one would do the face, but this can cause other issues such as the fact you have to render EVERYTHING every time just for the face and body.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Custom Transparency shader occasionally losing transparency? 1 Answer

How to get the depth values of the camera view? 1 Answer

CommandBuffer.SetRenderTarget becomes strange with BuiltinRenderTextureType.Depth 0 Answers

Debug Rendering using the depth buffer 3 Answers

Scene View Camera Depth Texture? 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