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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by fospher · May 23, 2012 at 08:39 AM · iosguitextureonmousedown

Does onMouseDown convert to a Touch command in iOS or not?

The Unity documentation says that onMouseDown does NOT convert, but this thread says otherwise.

According to this other thread , this might not work due to the image not being a power of 2. I converted and re-imported the image. All without success.

Also, I have tested this, and it doesn't work, but maybe there's a checkbox somewhere I'm not ticking?

Anyone know for sure?

If not, help with using touch with a GUItexture would be much obliged.

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 Bunny83 · May 23, 2012 at 07:51 PM

I can't see any post in the thread that states it would work on mobile. Do you refer to nicholas post? He said that they emulated mouse input and generated the function calls manually.

Usually Unity automatically casts a ray each frame to check which object is below the mouse position. On a mobile build this has been disabled for performance reasons. You can still do it manually.

Also note that GetMouseButtonDown is a function, not a callback like OnMouseDown.

Btw your question seems to be flipped ;) I guess you mean if a touch translates to OnMouseDown and the answer is: no.

Comment
Add comment · Show 1 · 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 fospher · May 25, 2012 at 12:34 AM 0
Share

Thanks Bunny83. I don't assume I need to do a ray cast considering I'm using a GUI which does not have a position in space, only regarding on the screen.

I am using Input.mousePosition along with an Input.GetTouch to detect if there was a touch, and where the touch was. It works if I just make an on$$anonymous$$ouseDown callback with an actual mouse, but not if I use a Update callback with a touch detection. If I detect touch, and then use mousePosition, will it register the position properly?

Oh, and I guess it depends from what side you're looking at. I'm guessing that if I'm compiling for iOS - the on$$anonymous$$ouseDown will convert to touch - but if you're looking at it from an app on the device standpoint then it would be the opposite.

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

Is GUITexture slow on iOS, and would it be faster to use a plane and a separate camera? 0 Answers

move a gameobject from a GUITexture 0 Answers

iOS GUITexture not enabled still receives input 1 Answer

It seems to me that if I click on a GUITexture the click event is captured not only by the texture but also by the object behind it 2 Answers

Capture a screenshot and use it as a GUITexture on iOS 2 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