title: LibGDX Box2D player is stumbling
body: <p>I'm trying to program a simple 2D platformer, and I want the player to go over some platforms. Unfortunately, my player stumbles after some platforms for no reason:</p>
  
  <p><img src="https://i.stack.imgur.com/2QTfQ.png" alt="enter image description here"></p>
  
  <p>And that's clearly not what I want. The only thing I can imagine is that the boxes aren't the same height for some reason... But how to fix that? Here's some of my code:</p>
  
  <p><strong>createPlatform...</strong></p>
  
  <pre><code>public static Body createPlatform(World world, int x, int y) {
      BodyDef bodyDef = new BodyDef();
      bodyDef.type = BodyDef.BodyType.StaticBody;
      bodyDef.position.set(new Vector2(x, y));
      PolygonShape shape = new PolygonShape();
      shape.setAsBox(1, 1);
      Body body = world.createBody(bodyDef);
      body.createFixture(shape, Constants.GROUND_DENSITY);
      body.resetMassData();
      PlatformUserData userData = new PlatformUserData(1, 1, Constants.GROUND_IMAGE_PATH);
      body.setUserData(userData);
      shape.dispose();
      return body;
  }
  </code></pre>
  
  <p><strong>Runner.java - act()</strong></p>
  
  <pre><code>@Override
  public void act(float delta) {
      super.act(delta);
      body.setLinearVelocity(new Vector2(10f,0));
  }
  </code></pre>