(Input.GetKeyDown("space")) or (Input.GetKeyDown(KeyCode.Space))?

The scriptingAPI page it lists both. Is one better than the other? I just found out after writing if(other.tag == “Player”) for months that if(other.CompareTag == (“Player”)) is more efficient… so is one of the keyDown versions better than the other?

Input.GetKeyDown( string ) requires a string defined in the InputManager. So, if your InputManager is “empty”, this function won’t work. Without mentionning that space can be mapped with an other key than the spacebar (in the input manager or by the user if you have enabled the configuration box)

Input.GetKeyDown( KeyCode ) requires a specific key, no matter what.

Using the KeyCode version is clearly more efficient than the string version, but is less flexible.