- Home /
How can I detect a right-click on my UI button?
Hi I have set up an inventory system and I'm now trying to detect a right mouse click on a UI button (new UI System). I've seen some answers here on the website but I can't figure out how to do this in Javascript. Would be awesome if somebody could help me.
Answer by Jessespike · Oct 16, 2015 at 06:13 PM
button values are 0 for left button, 1 for right button, 2 for the middle button.
http://docs.unity3d.com/ScriptReference/Input.GetMouseButton.html
Thank you worked! I used the event trigger 'pointer down' together with your solution.
Your answer
Follow this Question
Related Questions
Text wont change to correct value 1 Answer
Only want to detect button click event 1 Answer
How do Pointer events work? 4.6 UI 1 Answer
Get Global PointerEventData 1 Answer
Toggle Button: different color for ON and OFF state? 3 Answers