- Home /
Converting button to mouse click
can someone please help me change this to a left click on the mouse button. Thankyou
if(Input.GetButtonDown("Jump"))
Comment
Best Answer
Answer by zannghast · Nov 03, 2010 at 05:03 AM
By default, the correct code would be:
if (Input.GetButtonDown("Fire1"))
That's if you didn't change any values in your project settings. More info on that function HERE.
Alternatively, you can also use the following code to process anything when the left (0), right (1), or middle (2) mouse button is "pressed":
if (Input.GetMouseButtonDown(0))
A bit more info on that function HERE.
Your answer
Follow this Question
Related Questions
Only updating once during left mouse button being held down. 3 Answers
Can't shoot towards mouse click point 0 Answers
Can't shoot towards mouse click point 1 Answer
Click to destroy object 2 Answers
Run script when object is clicked 1 Answer