Hello. I've asked this in the Chipmunk forum also, I'm getting desperate after days and days of failures. Anyway, I simply want to move a Chipmunk body by setting it's position to be the same as a sprite's position which sits within a parallax node. The first part of my code creates the shape and body and adds the sprite, then removes the body from the space. Credit goes to Mobilebros for this.
ppShape = [smgr addRectAt:ccp(160, 100) mass:INFINITY width:92 height:12 rotation:0];
cpSpaceRemoveBody(smgr.space, ppShape->body);
ppSprite = [cpCCSprite spriteWithShape:ppShape file:@"level1Pad.png"];
This second bit is supposed to move the body around, but what happens is the body (or shape) stays where I put it. I believe the shape will move if I move the body, bt that appears to not happen and I can't move the collision shape.
ppShape->body->p = ccp(_level1S.position.y + 10, _level1S.position.x + 160);
So, to recap, I simply want a body not effected by gravity, which I can move by setting it's position to the position of a moving sprite. The body must allow things to collide with it.
Help!
Thanks.