Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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
3
Question by Jasper1900 · Oct 28, 2014 at 01:52 PM · 3dcanvas4.6

[4.6 - UI] How to add 3d objects as canvas child?

Hi,

I want to have a 3d object as any other in my User Interface (I am using the new UI system, 4.6). It has to be a child of a rect transform object. If I add a basic cube as a child of the canvas it does not render (but it does in the inspector). Does anybody know any solutions for this?

Comment
Add comment · Show 7
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 thegabe · Nov 24, 2014 at 08:35 AM 0
Share
  • I wan't to know this too.

avatar image Umai · Nov 25, 2014 at 02:59 AM 0
Share
  • $$anonymous$$e three.

avatar image alehano · Dec 03, 2014 at 11:49 AM 0
Share
  • me too.

avatar image thegabe · Dec 03, 2014 at 12:14 PM 0
Share

I have done it with a RenderTexture. But this only works with unity pro on mobile.

avatar image troien · Dec 03, 2014 at 12:15 PM 1
Share

When you set you Canvas Render$$anonymous$$ode to ScreenSpaceCamera or WorldSpace, your camera will render your 3d object (Depending on which layers it renders and in which layer your 3d object is ofcours). The way it currently works I believe is that 3D objects are placed relative to the pivot position of the parent. Which does allow you to control the position reasonably well, I assume there are also ways to control the scale so that it fits in screen % etc. But I haven't found that yet.

Show more comments

4 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by Lardalot · Dec 06, 2014 at 01:55 PM

Set your Canvas type to screen space camera. Set the scenes main camera on the canvas. You might need to tweak clip distances or canvas plane distances to make sure things are in view.

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
0

Answer by Mmmpies · Dec 03, 2014 at 09:48 PM

If using the free version, then you can't use RenderTexture but you can setup a separate camera that you can enable when in the menu. As long as the depth of the 3d objects is closer than the background for the GUI you should be OK.

This is a "very" basic setup I've got: alt text

The canvas background and X button are the new GUI and the swords are 3D rotating objects.

Put the camera under the terrain facing in a direction it's not going to render anything else.

Set Clear Flags to Depth only. Create a layer for your 3D objects and set the Culling Mask to that layer. Projection should really be orthographic but it's not essential so if you want a certain look then that's OK.

These are the settings on the camera I use:

alt text

I did have a link for a full tutorial on this with the old GUI but can't find it. It still work with the new GUI.

Basically create the camera, make sure it only displays stuff in the layer for the 3dGUI camera and then set a blank game object close enough to the camera to display in front of the GUI canvas.

Create your first 3D object at the blank game object and whatever x,y,z increase so it then moves the next item along the axis to the right.

I'll try and find the tutorial but it's getting pretty late where I am so it might/will not be tonight!


cam3d.png (18.1 kB)
3dmenuitems.png (459.4 kB)
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 Mmmpies · Dec 03, 2014 at 10:07 PM 0
Share

PS Can't really do it on "free" as a rect transform but with a bit of imagination you can place it in the same area, just rendered by the additional camera. You just need to experiment with scrolling the uGUI at the same time as you scroll the 3dGUI camera. Oh and be careful with those different aspect ratios Eugene!

PPS I'm guessing most people are too young to get the Pink Floyd reference, in fact I guess most are too young to get PS and PPS, or at least not British.

avatar image
0

Answer by sysmaya · Aug 08, 2016 at 03:59 PM

Two cameras. One Main Camera. Two for GUI Menu.

https://xinyustudio.wordpress.com/2013/11/05/unity3d-make-3d-objects-over-gui-surface/

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
0

Answer by christougher · Apr 16, 2017 at 07:21 PM

I know this is old, but here is a great asset to help align mesh objects on the screen.

https://www.assetstore.unity3d.com/en/#!/content/75607

I'm not the author, it's free, is super easy to use, and if you want to have objects overlay the canvas you can use screen space camera.

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

34 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

Related Questions

3D Objects on a UI canvas with LWRP? 2 Answers

Infinite ScrollRect? 1 Answer

2D object Image Look at 3D object Pointing 1 Answer

How to get screen position of a RectTransform when canvas render mode set to "Screen Space - Overlay" 1 Answer

Optimizing Performance in Scenes with Moving Canvasses 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