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 Diego89 · Jun 18, 2013 at 09:08 AM · ui

How make an Interaction with object like the last of us?

Hi these days, I'm playing the last of us, one of my favourite small feature is like the game make clear which objects are important. Creating a small white circle infront of them, and then when the player can interact the internal part of the circle became a texture of which button the player has to press to interact.

http://www.youtube.com/watch?v=HawhjjF5qFc

in that link is visible from minute 3.00.

However my question is anyone has an idea about how to create a similar effect in unty?

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

1 Reply

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

Answer by BPR · Jun 18, 2013 at 09:43 AM

Well that are basically just Textures which are blended over the mesh, a simple but dirty approach would be using two cameras, the first one does show the normal gameview everthing except the buttons/textures, the second one has a higher priority (depth!) and is therefore shown above the other camera and can see only the textures/buttons. As for the textures/buttons you are using planes with a transparency shader and a texture showing either a white circle or the button to be pressed. Obviously in your texture file anything but the cricle button has to be transparent, use a file format which supports transparency! These planes are positioned close to the objects to interact with in the scene. That's it! You can finetune the entire thing by for example setting the second camera to orthographic so the buttons/textures have always the same size no matter how far away you are and using scripts on the planes to always rotate them so they face the player. Also you can adjust their visibility/content with scripts.

Regards, BPR

Comment
Add comment · Show 2 · 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 DocteurCox · Jun 18, 2013 at 11:08 AM 0
Share

Another more simple approach would be to use the Camera.WorldToScreenPoint(yourObjectPosition) and then draw a GUI at the x and y pos returned by the aforementioned function.

 Vector3 screenPos = Camera.mainCamera.WorldToScreenPoint(someVector3);
 GUI.DrawTexture(new Rect ( screenPos.x, screenPos.y, 20, 20), yourTexture);
avatar image Diego89 · Jun 18, 2013 at 01:25 PM 0
Share

thank you both your solution are very usefull

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

16 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

Related Questions

Monodevelop #region 2 Answers

[C#] How to code within the Unity 4.6 new UI Panels? 0 Answers

Unity 4.6 Error different layout! 1 Answer

'Mission Complete/Game Over' screen once objective is complete. 1 Answer

Using events to change variables and inherit that value? 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