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 /
This question was closed May 24, 2014 at 07:31 AM by Fattie for the following reason:

Duplicate Question

avatar image
0
Question by acesion · May 24, 2014 at 05:30 AM · clippingocclusion

Orthogonal view image cliping.

I am using an orthogonal camera for a 2d game.

I have two objects being spawned on a "floor" at the same height. The first object is a grey car that has a transform height(perpendicular to the camera) of .25 and the 2nd object is a yellow car with a height of 1.

Since the 2nd object is larger than the first object I would think that the 2nd object should occlude the first object

however as seen in the attached screen shot the smaller object is actually appearing through the larger object even though it is technically inside the 2nd object.

The arrow marked as number 1 demonstrates the smaller grey object clipping through the larger yellow object.

The arrow marked as number 2 demonstrates that the yellow object is in fact on top of the smaller grey object. Note that even if I am in the 3D perspective this phenomena occurs when looking at the object from the same top down perspective as the orthogonal view.

Any ideas on how to fix this? I need the colored cars to be visible as they are selectable by the player while the grey cars are just for show.

alt text

ex2.png (495.0 kB)
Comment
Add comment · Show 3
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 Fattie · May 24, 2014 at 07:31 AM 0
Share

you must adjust the z axis of the objects. it's a very basic in making games. 100s of questions on here about it http://answers.unity3d.com/questions/473217/how-to-simulate-2d-layers-in-unity.html

avatar image fafase · May 24, 2014 at 07:34 AM 0
Share

Do you expect transparency to occlude? Because I think that is what you mean.

avatar image acesion · May 24, 2014 at 08:06 AM 0
Share

Fattie when you say adjust the z axis are you specifically talking about the location of the transforms origin or the transforms mesh? Right now the mesh of the yellow car is larger than the mesh of the grey car so it is technically above the grey car(so it closer to the camera), yet the grey car still shows through. Perhaps the renderer in unity only looks at the origin of the model when rendering an orthographic perspective but I doubt that. It could be something to do with the "transparent texture that I am using to get the alpha channel to work properly on my texture.

Also if I must change the location of the objects origin to be closer to the camera how do I do that while keeping the unit on the navmesh I have created since I am spawning these units dynamically from the same location and gravity pulls them against the ground?

0 Replies

  • Sort: 

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

Clipping all descendant game objects rendering in 2D 0 Answers

"Tree Soft Occlusion Leaves" shader has been shafted? 0 Answers

How to know if an object is ocluded 1 Answer

using OnBecameVisible or IsVisible with occlusion culling in Unity Pro 2 Answers

Unity 5 Parallax occlusion artifacts 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