I have 2 blocks with the same script on each one because I think it needs to be. The problem is when I drag the one block into the other my OnTriggerEnter is run for both blocks. I understand why its happening but I need it to happen to the block that is not currently being click/dragged.
What can I do to stop this?
asked Aug 16 '10 at 01:10 AM
I'm not sure it's the best way, but you could just have a boolean that you toggle in OnMouseDrag and OnMouseUp, and then check that the GameObject isn't being dragged in OnTriggerEnter.
I had a quick search but couldn't find a simple method to find which object was currently 'selected' (i.e. the focus of a MouseDrag). I'd be interested in a better solution, but this should work.
answered Aug 16 '10 at 01:26 AM