Always start walking left

I’ve noticed that any game I play that is made with Unity, the character is always walking left, even when I’m not pressing anything. I have no idea how to fix this. Any help?

Hello Benjamitez,

You really didn’t give us alot of information to work with but I have some ideas. What type of input are you using to control your character moving left? If you are using an Input.Axis then you should make sure you have defined a “dead zone”, otherwise small numbers in the axis will give you some movement.

For example:

public float movementSpeed = 10f;

void FixedUpdate()
{
   if (Input.GetAxis("Horizontal") > 0.1f)
      {
        rigidBody2D.velocity = new Vector2(movementSpeed * Input.GetAxis("Horizontal"), rigidBody2D.velocity.y);
      }
}

This will provide velocity to the rigid body only when the axis input is greater than 0.1. So very small numbers, such as 0.001, will not provide any input.

Another reason may be in your scripts. If you accidentally made your player the Child of a moving game object, it will follow that game object. Just some ideas.

Hope this helps.

Cranky Frank

If these are games in the unity editor, what is the script that is governing the Input to the players movement?
If you mean standalone games, do you have a controller attached to your compute? Have you tried a different mouse and keyboard?