In Quaternion.Slerp method, first parameter is the value you will want to change, and second parameter is the value to which you want to Slerp it to. So basically every frame you “Slerp” from transform.rotation (current value) to rotation (target value). It would be best to rename rotation variable to something like targetRotation to avoid confusion for beginners.
As for second question, no it’s not the same. Input.GetButtonDown() is used for Keyboard buttons and GetMouseButtonDown() is used for all moiuse buttons.
Not entirely correct. GetButtonDown is used for getting the input from Unity’s input manager, which is works for different controllers. FE. GetButtonDown(“Fire1”) could be set up as either a keyboard button, mouse button or xBox controller button, etc.
But yeah, GetMouseButtonDown is indeed only for mouse buttons.
You’re right, my bad. I mistook GetButtonDown for GetKeyDown. GetKeyDown is the one that takes KeyCode enumerator as parameter. For example: Input.GetKeyDown(KeyCode.LeftControl);