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
0
Question by strideynet · Mar 31, 2016 at 10:11 AM · graphicsrendererhud

Draw 2D onto a 3D surface

I'm pretty deep into a project and i'm now essentially stumped. I can't find any similar questions so I guess I must ask. How can I draw a 2D HUD essentially onto a 3D surface. I previously worked with a game called GMod which had a feature known as 3D2D. Heres an example.

https://s3.scriptfodder.com/script_media/3401c07241ddf38ae90bdfa4a58cebed.png

How can this be achieved within Unity? I'm a pretty adept coder but have always hated HUD/Graphics stuff as the maths is beyond me most of the time!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Eudaimonium · Mar 31, 2016 at 10:44 AM

You can setup your HUD and UI the normal way - build a Canvas, assign it a camera etc.

Have the camera output to a RenderTarget instead of screen.

Then simply assign the RenderTarget as a Texture on the material of In-game object.

http://docs.unity3d.com/Manual/class-RenderTexture.html

As to actual interaction with the HUD on the object itself, that's going to be a bit tricky and more specific to your project. It's possible to obtain a raycast hit point on the object, re-calculate how that translates to Canvas HUD and apply the click action there, but it'll require some tinkering.

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 Jason_ioosh · Mar 31, 2016 at 04:12 PM

Hi @strideynet,

I had a similar problem to you this morning, and what I did was simply adding a canvas component to the gameObject where I wanna display my HUD.

I'm not really an adept coder, so there might be some other ways or methods which I'm unaware of.

But using this method, I was able to control what UI elements appear on the gameObject itself, though I'm unsure how much of a performance hog this method would be.

Cheers, Jason

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Render a camera multiple times in a single frame? 1 Answer

Raycast trail renderer? 3 Answers

why is my Gun Model Only rendering the front bit when the animations are on? 2 Answers

Problem with open world games 3 Answers

Why isn't my gun showing up when I play in maximised mode? (Mechanim Animator) 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