0
votes

I have a GameCharacter located centrally bound to vertical movement only (jumps) with a prismatic joint. At init I load various GameObstacles off screen that when "spawned" move from offscreen toward the character. Preferably I'd like to control this repositioning of the GameObstacle movement with cocos2d position updates rather than box2d velocity controls.

Basically, I want my GameCharacter to react to the GameObstacle but I don't want the GameObstacle to react to the GameCharacter AND I want to be able to change the GameObstacle position outside of box2d.

I tried just updating the GameCharacter body rather than all bodies but obviously I see my Obstacle sprite move without it's body. I don't think collision filtering is the way to go. Any suggestions appreciated.

1

1 Answers

0
votes

answering my own question here....

i think kinematic bodies are the trick here. i dont think it is preferred to move the body in a nonphysical way (like settransform) but rather use linearvelocity. i >think< i could potentially convert my planned movements to linear velocities using some physics ...