Greetings,
I've been looking at example 11 all day. Its where you can drag UI elements on to 3D objects and create a pre-fab on them.
I slimmed the whole thing down to just a draggable icon, and the box to drop it on. All works.
Change over to my scene.
I have a UI Root, with a Drop Panel Root. My sprites have box colliders, as does my target box. Here is my release code (which inherits from UIDragDropRelease)
protected override void OnDragDropRelease (GameObject guy)
{
Debug.Log("Release Mine");
if (guy!= null)
{
Debug.Log("Object is found");
}
base.OnDragDropRelease(guy);
}
If I take my sprites and copy paste them into the example scene 11, they work, the surface is detected when dragged over the box. If I take my box that Im trying to have things dropped onto, and place it in scene 11, it detects the surface.
I feel my scene is a mirror image of example 11.
So, given that:
a) I can successfull drag a UI element around the screen with UI drag item
b) Every time I release the object, even if over a box collider object, the surface is still always 0
What can you suggest I look at to figure out why the surface is never getting detected?
To Further Clarify:
1. If I bring in a drag object from my scene to the example scene, the surface is found when dragged over the box
2. If I bring my target box from my scene (where Im trying to drop items to) to the example scene, the example items will drop on to my sample box
3. If I bring the box and the draggable item from the example scene and add them to mine, the surface is not found
Ive noticed that the UICamera.hoveredObject is valid in the example scene buts its always null in mine.
Is there a reason that UICamera.hoveredObject could come up null when I am mousing over a box with a collider?