Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using a kinematic body for my moving platform on x-axis, so I set the linear velocity to b2vec2(5,0).

When the player jump on the platform, it works like it is suppose to. But the thing is that my platform is on the obstacle layer and I am moving it with the parallax layer.

So if I setTransform the kinematic platform to follow the obstacle layer than it's physics will not work and the player will slip-off the platform.

I'm developing for iOS and using cocos2d api. Anyway around this?

share|improve this question

I've found a solution. I calculate the layer offset difference then minus it from the velocity and apply it to the setLinearVelocity rather than the setTransform method. Cheers.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.