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
9
Question by DustyScreen · Sep 11, 2014 at 07:47 PM · ui

3d GameObject anchored to the new UI canvas

I'm trying out the new UI system (unity 4.6 beta 17) and so far it's great!

I'm trying to create a HUD, that scales to different screen sizes, which is very easy in the new system. However I want to place a 3D-model (rotating weapon) as part of the HUD, anchored to the upperright corner using the rect transform-anchoring.

Unity seems to get unstable, when I mix the rect transform and 3D-renderer... Maybe because beta, maybe because I'm doing it wrong.

Anyways, is it possible to do what I want to achieve in some way? Any hints are very welcome :-)

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 sergienko88 · Nov 12, 2014 at 08:08 AM 0
Share

I have this problem too :(

avatar image Sergio7888 · Oct 07, 2016 at 06:20 PM 0
Share

First You are using a old beta version you can download the actual unity version here Download Unity or download the stable version 4.6 here Unity download archive.
The best way to use 3D objects in UI is create a Camera for the object and a RenderTexture Asset, put the render texture in the camera "Target Texture" field, in the canvas use a Raw Image component and select the RenderTexture as the Raw Image "Texture" field.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by fafase · Nov 24, 2014 at 08:59 AM

Create a second canvas and make the render mode WorldSpace. Now you can use 3D models.

Comment
Add comment · Show 6 · 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 thegabe · Nov 24, 2014 at 09:17 AM 0
Share

I have done that. I haven't changed other settings. It still does not show in game window, just only in scene editor.

avatar image fafase · Nov 24, 2014 at 09:23 AM 0
Share

Where is your canvas and where is your object? When using World Space, the canvas is now in world position so if your camera is at (0,0,0) your canvas needs to be somewhere there as well. You also need to update your canvas position so that it follows the camera.

avatar image thegabe · Nov 24, 2014 at 10:08 AM 0
Share

It works! The problem now is that the 3d object intersects other object in the scene.

avatar image fafase · Nov 24, 2014 at 10:26 AM 0
Share

Remove collider, But best would be to have a second camera that you use for that purpose, then using Depth, you would render that UI camera over the world camera so that your 3D model is always on top and never interacting with the others.

This second camera would be placed somewhere far enough where nothing happens.

avatar image thegabe · Nov 24, 2014 at 01:03 PM 0
Share

I've done it with a rendering it to a texture.

Show more comments
avatar image
-2

Answer by cregox · Nov 18, 2014 at 10:47 PM

Just create a regular UI canvas and add your 3D object inside.

Hierarchy View:

 + Canvas (Rect Transform, Canvas)
     + Panel (Rect Transform)                  -> this is the anchor
           3D Object (Regular Transform)       -> your 3D gameObject
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 thegabe · Nov 24, 2014 at 08:52 AM 0
Share

It doesn't render in game window only in scene editor.

avatar image glitchers thegabe · Jun 21, 2016 at 04:38 PM 0
Share

You need to set the layer of the 3D object to UI

avatar image Rodolfo-Rubens · Oct 07, 2016 at 05:57 PM 1
Share

That doesn't work. The 3d model it's still part of the game world causing shadows and etc and doesn't not get rendered as part of the UI.

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

30 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

Related Questions

How to click on button that is behind transparent image in New UI? 2 Answers

Making a GUI element follow the cursor without delay. 2 Answers

New UI: How to change depth/order from script? 4 Answers

How to fix the world space canvas not showing in game 0 Answers

Canvas Graphics raycaster, prevent 2d and 3d physic raycast 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