Box2D Platform body not moving player body along with it

Posted by onedayitwillmake on Game Development See other posts from Game Development or by onedayitwillmake
Published on 2011-07-22T00:26:01Z Indexed on 2012/11/27 23:33 UTC
Read the original article Hit count: 392

I am creating a game using Box2D (Javascript implementation) - and I added the ability to have a static platform, that is moved along an axis as a function of a sine.

My problem is when the player lands on the platform, as the platform moves along the X axis - the player is not moved along with it, as you visually would expect.

The player can land on the object, and if it hits the side of the object, it does colide with it and is pushed.

This image might explain better than I did:
After jumping on to the red platform the player character will fall off as the platform moves to the right

example

UPDATE:
Here is a live demo showing the problem:
http://onedayitwillmake.com/ChuClone/slideexample.php

© Game Development or respective owner

Related posts about 2d

Related posts about 2d-physics