Box2D Forums

It is currently Tue May 21, 2013 6:49 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Feb 10, 2012 12:16 am 
Offline

Joined: Fri Feb 10, 2012 12:06 am
Posts: 1
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?


Top
 Profile  
 
PostPosted: Fri Feb 10, 2012 1:59 am 
Offline

Joined: Sat Jun 18, 2011 2:36 am
Posts: 3
Calculate the layer offset difference then minus it from the velocity and apply it to the setLinearVelocity rather than the setTransform method. Cheers. ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group