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 judy3turn · Nov 29, 2013 at 10:33 PM · renderorder

2D Toolkit in 3D world

I've been checking out the 2D toolkit to use for mini-games within my world. I want to be able to put a 2D "game" in front of the 3D world as if someone had a journal or something in their hand, but can still look up and converse in the world.

I got it to work up to a point with the first person controller. It works all the way up until an object in the 3D world is closer to the camera than the sprite. Is there a way to force the sprite to always render on top? I've played with all the culling masks.

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 AlucardJay · Nov 30, 2013 at 02:03 PM 0
Share

For this you'll probably need a shader that draws the 2D items over the top of everything else. I used to have a shader called 'TextOverlay' that would do this but cannot find it :(

Try searching for shaders, and post back your findings. I shall also keep looking and post back if successful, as I'm also after this for my 2D elements.

$$anonymous$$aybe try in the forums? : http://forum.unity3d.com/forums/16-ShaderLab

Or also check the shaders that come with UIToolkit or NGUI.

avatar image judy3turn · Nov 30, 2013 at 08:08 PM 0
Share

Thanks. I had some success by moving the UI items .02 away from the camera (had to resize the elements for this so not sure if I'm adding more CPU cycles or not) and expanding the bounding box on the character by .04 so that nothing could get in between the two. Shaders would be better as it would give me greater freedom in setting up the UI. But I wanted to share this as my "hack it to make it work for now" solution while looking for the correct way.

I'll look into what we can do with shaders.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by belvita · Dec 01, 2013 at 08:36 AM

For this task

U must use orthographic camera and If u use fpc firs per cont...... U must disable the mouse look script inside character controller and u must Change the first person controller script also and delete the camera inside the fpc it takes 3 steps to turn the 3d environment to 2d like that.then u r ready to go easy.

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 AlucardJay · Dec 01, 2013 at 01:24 PM 0
Share

Unfortunately you have misinterpreted the question. This is about depth sorting the elements drawn by 2 different cameras. If an object in the second camera is further away than an element in the first camera, the element in the first camera will be drawn over the element in the second camera. The only way I've come across to always have your second camera elements draw over every first camera element is to use a shader that takes priority and ignores depth sorting.

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

19 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

Related Questions

Unlit transparent shader render order issue 1 Answer

GameObject is rendered behind despite having lower z value in 2D space 0 Answers

How to Render an Background on Top 2 Answers

Water in cubemap 1 Answer

Is it possible to pass SubShader tag as a parameter? 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