Check whether a key is held down

Hey Folks :slight_smile:

this might be a silly question but how do I check if a key is hold down ?

Input.GetKey or

Input.GetButton ?

The thing is I like an object to be controllable while the player is holding down the shift key but when he lets go of it the object is supposed to get destroyed.

Any hint how I can check whether the key is still pressed?

Cheers!

Dawnreaver

GetButton : Returns true while the virtual button identified by buttonName is held down.
if(Input.GetButton(“buttonname”)) {
do this code
}

Cheers Mate :slight_smile: