calling getbuttondown and getbutton on same button

Hi, everyone, I was wondering if there was a way to make it so that `GetButton` and `GetButtonDown` were called on the same button in the same function. All help is appreciated!! :)

Just call them both with the same button?

1 Answer

1

JS

function Update()
{
    var button : boolean = Input.GetButton("SomeButton");
    var buttonDown : boolean = Input.GetButtonDown("SomeButton");
}

C#

void Update()
{
    bool button = Input.GetButton("SomeButton");
    bool buttonDown = Input.GetButtonDown("SomeButton");
}

Thanks a lot. Great answer, too, putting in both c# and js!!! :)