- Home /
Detect mouse collision over an object
my purpose is to Identify the objects located in 5 regions.Once who successfully finish this game he would be able to correctly identify objects located in these 5regions.If on the other hand he is unable to place the element into its location/area or he incorrectly places the element that element will disappear followed by the appearance of new element.
suppose there are 4 layer namely L1,L2,L3,L4 and each object is given an number(1,2,3,4).When I drag and drop the object(1) on L1,its should print a message "where the object is being dropped". (no need of mouse over... any mouse collision concept).
L1 L2 L3 L4 AREAS ARE IN DIFFERENT LAYERS.
I don't see a clear question here. You can detect the moues over an object by having an On$$anonymous$$ouseOver() callback on a script attached to each object. Or you can use Physics.Raycast() on a single script to test if specific objects are under the mouse.