How would I change the walk of my Character

I was wondering how to change a characters walk speed in any direction through script? Possible?

In the character controllers that come with Unity, they have a speed controller...

Check the CharacterMotor and FPSInputController scripts... But also, they have pre made controllers: First Person Controller

Drag that into the scene editor, and then on the side, it'll have Movement, click that, and you can change the speeds...

Good luck!

Definatly possible! You could do that on an E-reader even. Unity3D can do it sleeping.

Characters use controls, hence the object in the physics tab was created with the aptly chosen name: "Character Controller".

Pick your player, throw it on there and build a script component on it aswell JS/C# doesn't matter for this.

The script if it is a part of an object is a monobehaviour. All monobehaviours have a

//Requires derivation of the Monobehaviour class (same for Boo)
... : Monobehaviour

void Start()


void Update()


Using Javascript every script automatically derives from MonoBehaviour. When using C# or Boo you have to explicitly derive from MonoBehaviour.

function Start() {


function Update() {


Now I have no idea what level of programming you are on so I will forfeit explaining all the details and assume you know how to google or just notify so we can go over that part.

For now I'll lend a hend with what I do know can help:

Unity3D library comes with a Character Controller function called Move

Using Input.GetAxis("Horizontal") is quite common in combination with transform editing, for other input check here: However this is not really movement , it is short range instantaneous movement (Short - Teleportation) and does not check for collisions among with many other things you are going to dearly miss when mimicing any humanoid movement controls.

The Move demands a parameter of the type Vector3 containing x y and z cordinates. This should be all you need for now I think. Give it the direction Vector ( home-made ) and it's all good to go.

Speed is just a minor edit from here, just increase the direction Vector with a speed variable. But don't ignore the math before you get bugs.

The problem with the question is that it doesn't provide enough details. "change a characters walk speed in any direction" could be interpreted many ways. walk could be an animation and you could be attempting to change the playback speed or walk speed could indicate a variable that you multiply your movement by in some script that moves your character (could use a characterController or a rigidBody or explicitly set transform.position). In any direction could be interpreted as "in all directions", meaning that this is a global change to whatever walk speed is or it could be interpreted as "in any specific direction", meaning that this is a selective change.

To change the speed of an animation, you would do something like:

animation["walk"].speed = foo;

If your speed is some variable by which movement is multiplied, you would simply change the variable like so:

var walkSpeed = 3.0f;

//somewhere you'd have something like:
if(walking) movement *= walkSpeed;
//and then you'd move with it however your movement is controlled

//To change it would be something like:
walkSpeed = 5.0f;

If you mean to do it in all directions, then the above is sufficient.

If you mean to do it in specific directions, then that gets a bit trickier. You would essentially separate out the movement components and act on them differently and change how you are acting on those separate components:

var horizontalWalkSpeed = 3.0f;
var verticalWalkSpeed = 1.0f;

//somewhere you'd have something like:
var movement = Vector3(Input.GetAxis("Horizontal"),Input.GetAxis("Vertical"));
//This doesn't do the best on diagonals, but this is just an example
if(walking) {
    movement.x *= horizontalWalkSpeed;
    movement.y *= verticalWalkSpeed;
//and then you'd move with it however your movement is controlled

//To change it would be something like:
horizontalWalkSpeed = 5.0f;

//If you wanted to act on only specific directions like forward v. backwards,
//you could check the specific direction separately as well and operate on that.
//For something a bit smoother, lerping based on the absolute value of a
//dot product of some direction works fairly well

//for an animation, it would be much the same idea, 
//but you would have to know the direction and use that to control the speed
animation["walk"].speed = Mathf.Lerp(verticalWalkSpeed,horizontalWalkSpeed,

Attach script that uses `CharacterMotor motor = GetComponent(typeof(CharacterMotor))` to get the CharacterMotor on your player, then change `motor.speed` to a higher value