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
1
Question by Yarbrough8 · Feb 04, 2015 at 01:51 PM · c#eventeventsysteminterface

Can I use EventSystems to receive PointerEvents anywhere on screen?

I'd like to use the EventSystems class to receive mouseclick or touch events and get information such as position from them without the need for a button object in my scene.

I know how to implement IPointerDownHandler etc. on a custom button, but how would I do the same thing to receive a pointer event anywhere on the screen?

Basically, I'm looking for a clean system that manages touch and mouseclicks anywhere on screen and brings those different input methods together, so that I end up with a function like GetDragAmount(), which returns a drag distance for either mouse or touch drag. (I know how to write the basic functionality for everything, I just don't know how to turn it into a clean event system.)

Thanks!

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 Mmmpies · Feb 04, 2015 at 02:30 PM -2
Share

Technically the answer is yes, however what are you wanting to use it for?

you could certainly put a panel on a canvas with Alpha set to zero, but there are drawbacks. If you wanted to click something behind that panel you couldn't.

So again what is it you want it for?

avatar image Fattie Mmmpies · Jan 31, 2016 at 05:53 PM 1
Share

this comment is rather silly. there are endless examples of where you need to "detect a touch anywhere on the glass".

Generally, don't ask "why do you want to do this" questions please

avatar image Yarbrough8 · Feb 05, 2015 at 07:36 AM 0
Share

For now I've been writing my own input class, which polls Input.Get$$anonymous$$ouseButton() etc and then sends my own OnPointerDown events and such whenever I click or touch. I just thought it might be possible to use the Unity EventSystem, which basically has all the event functionality I need built in, but since it needs to have an actual panel/button object in the scene I couldn't use it yet. But if there is no smart way to use it for click events anywhere on screen, I'll stick to my own version.

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How do I stop EventSystem.currentSelectedGameObject from changing on a button press 0 Answers

How to call an implemented custom Interface 1 Answer

passing function to class 0 Answers

passing function to class 1 Answer

Multiple Cars not working 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