Disable Mouse Click on Object

Hi,

I am new to Unity. I am working on a project involving throwing a die. How should I write a script that makes sure the die is only thrown (pressed and then released) once? I want to show the projectile of the die after it has been thrown without any interference.

Try to:

  1. Use OnMouseDown event of the Monobehaviour (attached to your die GameObject) to “capture” the die.
  2. Use OnMouseDrag event to move the die if its was previously “captured”.
  3. Use OnMouseUp event to release/throw the die that was previously captured.