- Home /
Adding Shift as a Button
I tried using Shift in my 2D platformer to make my character run. However, Unity tells me that Shift isn't set up in the Input Manager. I tried setting it up, but whenever I type Shift as a positive button, it doesn't save the input. How do I set up shift as an input button for running?
Answer by roojerry · Mar 18, 2013 at 08:18 PM
Input.GetKeyDown(KeyCode.LeftShift); or Input.GetKeyDown(KeyCode.RightShift);
is this what you are looking for?
I would suggest Get$$anonymous$$ey rather than Get$$anonymous$$eyDown, unless you're using shift as a toggle, but otherwise yep, or simply check another example script (for the same answer) : http://answers.unity3d.com/questions/164638/how-to-make-the-fps-character-controller-run-and-c.html
I was looking for Get$$anonymous$$eyDown functionality. I was using GetButtonDown for some reason. Thanks!
Your answer
Follow this Question
Related Questions
InputManager crashes unity when downloaded from the Asset Server. 1 Answer
Why does InputManager have multiple axes with the same name? 1 Answer
Click strategy 2 Answers
Mouse Movements 1 Answer
Controller navigation of UI 1 Answer