Hello,
I’m having problems getting the OnMouseDown() / OnMouseUp() function to work on a particular building. In the console, it says “down” for every OnMouseDown, and “up”, for every OnMouseUp. You can see that on the one image, the OnMouseDown/Up functions don’t work. I don’t know why this is, the other building next to it is exactly the same except it has a different image, and it works. So I’m not sure why that one building doesn’t work, anyone know why?
Here is the link to the video:
Does that other building have all the requirements laid out in the OnMouseDown/Up() documentation?
Is there perhaps something else in the way, like an invisible collider?
Try run the game, press pause, then Destroy EVERYTHING else in the scene (delete it in the editor at runtime), then see if the building click works.
1 Like
Okay, this actually helped me narrow it down, apparently I accidentally moved a collider that helps me move around by dragging the mouse in my game, and the collider ended before the building. So I moved it back and it works now, thanks!
1 Like