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 PorkMuncher · Jan 20, 2015 at 02:47 PM · ui4.6pointerexit

OnPointerExit doesn't work

In the new UI the OnPointerExit (aswell as OnPointerEnter) doesn't work if instead of pointer leaving(or entering) - the UI element itself is moved while the pointer is stationary. Is this how it should work and how do I work around it?

Comment
Add comment · Show 5
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 KurtGokhan · Jan 20, 2015 at 02:56 PM 0
Share

I can't confirm if what you say is true but I can think of a workaround if it is true. Everytime the object is moved, check if pointer is inside/ outside the object (see: RectangleContainsScreenPoint)(or you may have custom logic). For example, if it was outside before moving and inside after moving then invoke OnPointerEnter.

Also I wonder, if pointer gets inside the object when object is moved but OnPointerEnter is not called, after that, will OnPointerExit be called if you exit normally?

avatar image PorkMuncher · Jan 20, 2015 at 03:03 PM 0
Share

It calls the OnPointerExit when I exit the original location of the element, even though it isn't there anymore.

I don't move the button itself directly, but it's parent panel, for which I update its position every frame for smooth lerping.

Really weird...

avatar image PorkMuncher · Jan 20, 2015 at 03:49 PM 0
Share

I found that if I stop the manual movement the exit event gets called immediately after.

avatar image PorkMuncher · Jan 20, 2015 at 06:22 PM 0
Share

Ok - short summary in this video: https://www.screenr.com/pquN

avatar image KurtGokhan · Jan 20, 2015 at 06:26 PM 2
Share

Hmm, I can't think of anything about this. $$anonymous$$aybe you should report it as bug since you already have the video they will consider looking into it.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by cucumars · Jul 01, 2018 at 10:03 AM

public class try1 : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler

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

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

Related Questions

[4.6 - UI] How to call an event with button when the pointer is up the button image. 1 Answer

Showing text on top of a Slider, but not blocking Handler? 1 Answer

Android screen is small? 0 Answers

Get object at mouse position? (UI) 0 Answers

4.6 Button OnClick Super Sensitive to pointer movement. 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