Widget OnDrop Does Not Trigger When Dropped On Level

Hi all. I am trying to implement a menu system, which basically works like this:

  1. User grabs an image widget, which represents a 3D mesh.
  2. When the image widget is dropped on the level, an object from that mesh will be created.

My problem is, OnDrop function is not called when the widget is dropped on the level, though I observe it being fired when the widget is dropped on other widgets and I also observe the mesh being created on the level. So it basically works fine when the widget is dropped on another widget, but does not work when it’s dropped on the scene.

I don’t know if this is the expected behaviour but I could not figure out how to accomplish what I aim for.

Thanks for any help.

on drop events will be called only on widgets, so this is the reason you only get response when you drop over widgets. My recomendation for you is create an invisible widget over all the game canvas to handle this event (ondrop) and then process it wiht raycast querys to know where in the level you dropped the widget