Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Drag and Drop OnDrop

I'm implementing Drag and Drop functionality for one of my items (which is represented as a widget blueprint containing an image). When the player drags the item onto another item it should combine the items. When the player drags the item into another area on the HUD it should destroy the item.

For my HUD widget blueprint I set my canvas panel to Visible and override OnDrop. Then in my Item widget blueprint I also override OnDrop.

The only problem is when the player drags the item onto another item BOTH OnDrop calls are triggered. I only want the HUD OnDrop (destroy item) to be triggered when the item isn't dropped on another item. Both should never be called for the same drop... only one or the another depending on whether we landed on another item or some other area of the HUD.

What can I do about this?

Product Version: UE 4.19
more ▼

asked Apr 23 '18 at 04:19 AM in Blueprint Scripting

avatar image

48 10 12 19

avatar image jr557 Apr 23 '18 at 03:10 PM

Drop Here is a visual representation. When Item 1 is dragged onto Item 2 (at least partially touching), only Item 2's OnDrop should be called. The red HUD's OnDrop shouldn't be called in that case.

If Item1 was dragged into the red area (not touching Item 2 at all), then the red HUD's OnDrop should be called.

Item 1, Item 2 are widget blueprints contained within the HUD's Canvas Panel.

drop.png (7.0 kB)
avatar image jr557 Apr 24 '18 at 07:25 PM

Is there any way to configure the widgets so that only the topmost widget has its OnDrop function called?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question