Aim Down Sight Script not working with GUI Button, but working with MouseButtonDown(0)

I am making a fps game for windows phone. I have an Aim Down Sight script for my gun. It works fine with Input.GetMouseButton, but when I try and use the GUI function instead, it draws it but does nothing. Here is the original script: #pragma strict

1 Reply

By convention, variables should start with a lower case letter. Functions and classes start with an upper case letter. Here is a bit of code that does with GUI what your original code was doing with OnMouseDown()/OnMouseUp():

Just wondering is there a way to do the same stuff, but is there a way to use the same script, but do it so i do not have to hold the button, just press it and it stays like that, and when I press it again it goes out of the ads. Sorry for bad grammar, I'm on my phone.