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
0
Question by tawhaki · Feb 22, 2015 at 04:08 PM · ui4.6

4.6 UI - OnPointerUp event doesn't fire if button released in different canvas child

I'm trying to make a UI in Unity 4.6 where I drag items from an inventory to a hotbar, which are separate entities in the canvas. For some reason, when I click drag from the inventory to the hotbar, the OnPointerUp event never fires. OnPointerDown works fine, and OnPointerClick also, and OnPointerUp will also fire if I'm keeping the cursor within the same child of the Canvas.

Anything I could be doing wrong?

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 tawhaki · Mar 25, 2015 at 07:05 PM 0
Share

I'm not sure you completely understood me.

If I used a OnPointerClick on the same image, it fires when I click it. If the cursor is present(over the image) for both OnPointerDown and OnPointerUp, it will fire OnPointerUp. If I press the mouse button over another element and then move to this one to release it, the OnPointerUp event will not fire. I have tried with the BeginDrag and EndDrag events and I couldn't get them to fire either.

I found this, it seems to suggest that any time the mouse button is released over something should fire OnPointerUp: http://forum.unity3d.com/threads/difference-between-onenddrag-and-onpointerup.305154/

avatar image TSRajesh · Aug 09, 2015 at 01:22 AM 0
Share

Did you find a solution to this? I have the same issue, (and find the answer provided of no use). Both OnPointerUp and OnEndDrag fires the event on the object where the drag initiated. Not where the drag ended..

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by TSRajesh · Aug 09, 2015 at 02:57 AM

For anyone who find this issue.. The Answer is IDropHandler.OnDrop It fires in the object in the End position instead of Starting Position.

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

Answer by DiegoSLTS · Feb 22, 2015 at 04:40 PM

There's nothing wrong, that's how OnPointerUp works. The pointer should be over the object when you release it for the event to be triggered.

Try something else, maybe what you want is OnEndDrag. If you're using the Event Trigger component you can add things for that event like you did for the rest. If you're doing it all by code you need to extend the IEndDragHandler interface on your script (and maybe IDragHandler too, I'm not sure).

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

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity Button raycast inconsistency issue. 0 Answers

EventTriggers kill ScrollRect ? 0 Answers

How to create a button for every supported resolution? 1 Answer

HELP! Buttons stop working when made a child of a "Canvas Group" empty in 4.6.3f1? 4 Answers

Render WebCamTexture to Sprite? 0 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