Right mouse detection

Hello, I'm new in unity 3d, and I have a little script. There, I have a function OnMouseDown to detect when the mouse click. But, it works only with the left mouse button... I'm usig Input.GetMouseButton(1) to detect if the pressed mouse button is the right, but the OnMouseDown function only is called when I click with the left button.

Please help me!

Thanks....

There isn't an OnMouseDown function for anything other than the left button, but you can sort of override OnMouseOver instead, like this:

function OnMouseOver () {
   if (Input.GetMouseButton(1)) {
      // do something
   }
}

Here's a complete solution for right click detection: http://blog.gfx47.com/2011/04/04/detect-right-click-on-game-objects-in-unity3d/ Hope that will help! ;)