# Unity 5: 3rd Person Controller runs by default. How to change this?

I have been working with the Third Person Controller of the Standard Assets (called Sample Assets in the beta versions) in Unity 5. When the player press the forward button, the character runs by default, and walks if you hold Left Shift, and I want to swap that.

However, The controller makes use of Blend Trees, and have two scripts to manage movement and input and it's far too complex for me and so I need your help. How can I change the controller so that the player walks by default and has to hold Shift to run?

The state of the Shift key is checked in the ThirdPersonUserControl.cs script which isn't that difficult.

To just swap the states you most likely (I haven't checked it!) would need to replace the

#if !MOBILE_INPUT
// walk speed multiplier
if (Input.GetKey(KeyCode.LeftShift)) m_Move *= 0.5f;
#endif


with

        m_Move *= 0.5f; // Do it before the #if to have your character walk by default on mobile devices too.
#if !MOBILE_INPUT
// walk speed multiplier
if (Input.GetKey(KeyCode.LeftShift)) m_Move *= 2;
#endif


or even with just

#if !MOBILE_INPUT
// walk speed multiplier
if (!Input.GetKey(KeyCode.LeftShift)) m_Move *= 0.5f;
#endif


if you want the character to run by default on mobile devices.

• Thanks Vladimir, that worked! Although I had to change the m_Move multiplier to 0.8f, otherwise the character would walk a couple steps and then freeze in mid-movement. For some reason the walk animation is no longer been played. Instead, character walks with run animation on a slower anim speed, but since my game is FPS, it doens't really matter. – Odival Quaresma Neto Apr 22 '15 at 18:46
• @OdivalQuaresmaNeto Glad I helped you! Not sure why it was necessary for you to change 0.5 to 0.8. I tried now with 0.5 and everything worked like a charm. – Vladimir Apr 22 '15 at 20:47