• 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
2
Question by THEAK472009 · May 28, 2014 at 01:18 AM · onmousedownmobileoptimization

OnMouse Event Handlers Might Impact Performance - Mobile

Hello, I am working on a mobile game and using OnMouseDown heavily. It works perfectly on the device but I keep on getting the warning "Game Scripts or other custom code contains OnMouse_ Event Handlers. Presence of such handlers might impact performance on handheld devices" Should I worry about it? If yes, what alternative do I have for OnMouseDown?

Thank You

Comment
Add comment · Show 1
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 cregox · Nov 18, 2014 at 07:23 PM 0
Share

I'm not sure why you accepted the answer. It doesn't really answer it to me. $$anonymous$$uch related: http://answers.unity3d.com/questions/784588/weird-yellow-warning-on-build.html

2 Replies

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

Answer by psychoj8 · May 28, 2014 at 01:23 AM

Take a look at that answer:

OnMouseDown alternative for mobile

And yes you shouldn't use OnMouseDown for mobile... it might not be a problem for now on ur device, but it might become on other devices

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 cregox · Nov 18, 2014 at 07:24 PM 1
Share

Which devices? What kind of problem? I've came up with a more complete solution to surpress the warning properly, following that alternative, but I still don't know why we should do it.

avatar image
2

Answer by rutter · May 28, 2014 at 01:21 AM

I've also seen that note, but haven't yet observed a heavy performance hit associated with it. Try it and see if you have any problems.

If need be, it's actually really easy to get the screen position for each touch, get the main camera to convert that to a ray, then raycast to check what the touch is hitting (if anything), then go from there. Do this once per frame, and you have your own "mouse" handler.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

23 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

OnDestroy collision detect 4 Answers

Stop a Lerp from looping 3 Answers

OnMouseUp error 0 Answers

iOS multiTouch / release - Strange problem 0 Answers

OnMouseDown If-statement Question 3 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