- Home /
how to stop a gameobject when releasing the left mouse button
Hi so this is quite simple but I am still a noob :) 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! :p
1) can you detect when the left mouse button is released ?
2) can you make an object move from a point A to point B during a certain duration (5 sec)
3) can you stop this object after a certain time ?
if you can do all that, then it should not be too hard
Answer by GoSuNeem · Oct 31, 2011 at 04:08 AM
Simple! :D
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!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Mouse Aiming Follow Wrong Direction - Help 2 Answers
Editing the standard FPS to work different 0 Answers
Blocky terrain optimization 1 Answer
Bullets dont delete properly 1 Answer