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 question was closed Apr 16, 2015 at 02:52 AM by AlwaysSunny for the following reason:

Duplicate Question

avatar image
0
Question by AlwaysSunny · Apr 15, 2015 at 11:22 PM · uiraycast

Most direct way to create OnCursorStay "event" in UI.

Is there a proper way to perform manual raycasts against UI elements?

Currently I'm implementing...

 IPointerEnterHandler, IPointerExitHandler

...and calling an OnEnter / OnExit method which helps track which UI Button element the user is highlighting with their cursor. (To achieve tooltip behavior, more or less.)

This seems to be rather failure-prone: I can easily perform mouse activities that fail to invoke the pointers events; most critically, the exit event. (My tooltips linger.) Losing application focus also seems to create a failed invocation.

This is very undesirable for me, so I'm seeking the most secure, stable way to create the equivalent of an OnStay behavior. I haven't had this specific desire before, so I'm a little lost.

Thanks!

Comment
Add comment · Show 2
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 Addyarb · Apr 16, 2015 at 12:35 AM 0
Share

Have you tried the built-in solution?

On$$anonymous$$ouseOver

avatar image AlwaysSunny · Apr 16, 2015 at 02:44 AM 0
Share

Tried it just to be certain. No dice. Thanks for your suggestion, though. These are UI elements belonging to a canvas; the doc says On$$anonymous$$ouseOver is for GUIElements or colliders.

I'll have a closer look at the UI docs to see what I can see about a roundabout solution, but I was hoping to learn the best way to handle this situation.

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by AlwaysSunny · Apr 16, 2015 at 02:51 AM

This wound up being what I needed. Apologies for the waste of time. :)

http://answers.unity3d.com/questions/821590/unity-46-how-to-raycast-against-ugui-objects-from.html

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

Follow this Question

Answers Answers and Comments

19 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

Related Questions

How to get UI element into HMD Unity 5.3.4p1 - Oculus Utilities 1.3 0 Answers

Create UI raycast like a mouse Click 2 Answers

Raycast a World Space UI with VR (Daydream) 1 Answer

How do I have clickable buttons in a scroll rect? 1 Answer

Is it possible to configure raycast to hit opaque pixels without using alphaHitTestMinimumThreshold? 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