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 /
avatar image
2
Question by mrpmorris · Dec 08, 2016 at 10:35 PM · uigameobject

Render a 3D object in a 2D UI Panel

Is there any way to put a 3D object inside a 2D UI? I want an object that is rotating, doesn't cast shadows, is visible regardless of scene lighting and (importantly) doesn't require any trick that involves adding a second camera as this slows down my game too much on mobile devices.

Comment
Add comment
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

4 Replies

· Add your reply
  • Sort: 
avatar image
12

Answer by Thaun_ · Sep 24, 2017 at 05:17 PM

This is how i did it: HowToImage make sure your Canvas is set to Screen Space - Camera and set your main camera in it. Then add your Object to the Canvas, just like you would do to any object. And then make sure the object is infront of the canvas. 3D Space

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 abeldantas · May 29, 2018 at 02:50 PM 0
Share

One of the problems with Screenspace camera is that the postprocessing stack on the main camera is ran on the cameras that are rendered bellow it. So, any postprocessing will be applied to the UI layers underneath.

avatar image Galder_6 abeldantas · Nov 16, 2020 at 09:23 AM 1
Share

One way to solve that problem is having an independent scene with all UI and add to your game with the option additive, when loading the UI. That will solve of having tons of UI elements in every scene you have.

avatar image Tkaewkunha · Jun 03, 2018 at 04:21 PM 0
Share

How to find the size of cube on the canvas?.

avatar image
2

Answer by Drakon0168 · Dec 09, 2016 at 06:18 AM

I would make a separate camera for the object put the object in a new layer and set the main camera's culling mask to everything except that new layer then set your new camera's culling mask to only see that layer. Then you can just angle the camera to look at whatever object is in that layer and position it however you want. make sure the object doesn't have any colliders otherwise game objects will still be able to collide with it. As for the shadows and lights that would all be in the mesh renderer component of the object. You can just turn lights, shadows and other effects on or off from there.

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 mrpmorris · Dec 09, 2016 at 07:25 AM 0
Share

As I said in the question, I don't want to use additional cameras because they slow the game down too much on mobile devices.

avatar image
0

Answer by elenzil · Dec 09, 2016 at 12:19 AM

Set up the canvas to be Camera-Space, not Screen-Space. It's fairly straight-forward after that.

Comment
Add comment · Show 5 · 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 mrpmorris · Dec 09, 2016 at 07:24 AM 0
Share

What are the steps after that? I don't have a clue.

avatar image SunnyChow mrpmorris · Dec 09, 2016 at 10:39 AM 1
Share

place your 3d object inside the ui.

with set as Camera-Space, the canvas behaves like a plane parenting to the camera in the 3d world. so all you need to do is parenting your 3d objects to that canvas

to make it no shadow, you have to set it in those mesh renderer

avatar image elenzil mrpmorris · Dec 09, 2016 at 06:00 PM 0
Share

yep. as SunnyChow said. just set up UI panels how you like, have one of them be an empty RectTransform (eg, add a "panel" object and delete the Image component) that's just for holding your 3D model.

you might need to fiddle with the z-position of the model and UI elements to get things to layer correctly. eg, so your model is in front of the background UI elements, and behind foreground UI elements (if any).

avatar image pixelsage · Jan 26, 2020 at 09:55 AM 1
Share

Yet again, I have spotted you in the wild (:

avatar image elenzil pixelsage · Feb 04, 2020 at 11:54 PM 0
Share

:D We meet again, again!

avatar image
0

Answer by Jayachandra205 · Apr 15, 2020 at 08:47 AM

Upon scan target Image, I have to show the 3D Animation Model along with Information in Text format. In this case I am trying to use the UI-->Panel to display 3D Animation along with Text information but 3D Animation model is not displaying and not working as expected n run time.

Could anyone guide me the right approach.

Cheers

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

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

107 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 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 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 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 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 avatar image avatar image

Related Questions

Grid Layout Group leaking outside canvas. 1 Answer

Canvas shrinks over time 0 Answers

Gathering GameObjects and then creating a button for each GameObject?? 2 Answers

Can't re-enable a gameobject 1 Answer

Masking GameObject in Canvas 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