I can’t seem to figure out the keycode for pushing down the scrollwheel button on the mouse. :?
input.GetKeyDown(KeyCode.Mouse3);
i think its that, heres a link to the keycode page Unity - Scripting API:
I tried that before I posted this it doesn’t work… ![]()
then try this
function Update(){
if(EventType.MouseDown){
if(Event.button==2){
// Do stuff hear
}
}
}
i havent been able to test this, because im not home, but hopefully this will work
alright another attempt then lol
function Update(){
if(Input.anyKey){
if(Event.current.button==2){
// Do stuff hear
}
}
}
alright i cant do it here, when i get home tonight i’ll try it out and let you know, sorry will be like an hour or two
Thanks ok, thanks for trying to help even though your away right now. ![]()
after looking at the input stuff i found the easiest way to do it lol…
function Update () {
if(Input.GetMouseButtonDown(2)){
//do stuff here
}
}
turns out theres a GetMouseButtonDown function, Unity - Scripting API: Input.GetMouseButton
thx
i am making a auto fire thing for my gun in my game so every time you move scrollwheel one bit it will fire = autofire ![]()