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 octaviomejiadiaz · Jun 07, 2012 at 05:42 PM · gameobjectbuttonaugmented realitygui-button

How to put an object as a button or a button that appears as a tracking model

I'm trying to put for example a plane, or a cube (GameObject) with a texture, but this object have to react like a GUIButton, but my code is in c++ , how do i can make this happen???.. please help i have trayed all. but nothing works for me.. :S

for example a stop(); or a play(); button to play audio.

Comment
Add comment · Show 3
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 octaviomejiadiaz · Jun 10, 2012 at 02:24 AM 0
Share

Im developin for IOS , so have to be touch.. So i cant use On$$anonymous$$ouseDown

avatar image Wesww · Jun 10, 2012 at 03:16 AM 0
Share

I see your problem. You're right, mouse scripts won't work for iOS. The solution is to raycast it. This answer looks about right:

http://answers.unity3d.com/questions/141893/detecting-taps-on-3d-objects-in-ios.html

avatar image octaviomejiadiaz · Jun 10, 2012 at 03:43 AM 0
Share

I forgott to say that is for ios, so have to ve touch, thats the problem, it could be onmousedown..mm

1 Reply

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

Answer by moghes · Jun 07, 2012 at 07:18 PM

if you want your cube to appear always on the top of everything, you have to use 2 cameras. to see this is detail check this question I asked a while ago http://answers.unity3d.com/questions/248295/can-i-have-a-prefab-appear-on-my-screen-like-a-gui.html

and to make it react for your mouse , simply create a script(c# which is almost similar to C++) since you can write in unity either C#,javascript or Boo. And attach the script to you box(gameobject) that will be your button.

The script should look like this: function OnMouseDown() { // play your audio }

make an another search to know better on how to play your audio file!

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Cannot click UI button. 4 Answers

Why does IsSleeping() keep returning false? (Billiard Logic) 0 Answers

How to get a parent object after clicking the childObject 1 Answer

Help touch button 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