• 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 ALex · Mar 25, 2010 at 02:04 PM · onclickpicturejpggif

Any way to show a picture on the screen when a model is clicked?

I would like in the scene to be abel to use the mouse to click on objects, which I can do and my scene works interactively when you move the object with the mouse, but first of all I would like a picture to come up that can be closed with an 'X' on click and a different picture for each model in the scene. Is this possible

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
3

Answer by runevision · Mar 25, 2010 at 04:14 PM

Yes, it is possible. Make a script with an OnMouseDown function and an OnGUI function and attach the script to your model.

  • Use OnMouseDown to detect the click on the model. In the OnMouseDown function you can set some boolean: showPicture = true;

  • Use OnGUI to make some GUI that is only shown when showPicture is true. You can use DrawTexture to draw your image. Also make a button that will set showPicture = false; and make the button look like an 'X'.

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 ALex · Mar 25, 2010 at 10:45 PM

Thank you very much for your help, I will be giving that a go tonight and tommorrow.

Cheers!

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 runevision ♦♦ · Mar 26, 2010 at 09:23 AM 1
Share

No problem! If an answer was helpful to you, don't forget to mark it as the accepted answer (click the check-mark next to the answer).

avatar image Lipis · Mar 26, 2010 at 05:12 PM 0
Share

And also these kind of posts consider adding a comment ins$$anonymous$$d of posting a new answer. $$anonymous$$ore info on how this works: http://answers.unity3d.com/faq

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

EncodeToJPG is too slow. Blocking main thread.Is there new way alternative? 0 Answers

load .png/.jpg from .txt-file 2 Answers

Animated GIF as a texture on Iphone 3 Answers

Play MP4 on UI? (Unity 3D 2018.2) 0 Answers

I need to take (save) a screenshot from a camera other than the main one. How would I do this? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges