how to stop a gameobject when releasing the left mouse button

Hi so this is quite simple but I am still a noob :slight_smile: I know how to get the input from the mouse button but I don’t know how to make the gameobject stop when the left mouse button is released?please help! :stuck_out_tongue:

Simple! :smiley:

inside your update/fixedupdate etc… add in…

if(Input.GetMouseButtonUp(0))
{
  //Stop your object
}

If you are already setting your mouse button into a actual “button”, use Input.GetButtonUp(“Fire1”). and you might want to check this page out. ;]

http://unity3d.com/support/documentation/ScriptReference/Input.html

Good Luck!