Problem with positioning node with body
Posted: Wed Sep 03, 2014 7:50 am
Hello
I am using cocos2d v3.2 with Chipmunk, here is my problem:
There are two nodes with bodies ( NodeA, NodeB). I am moving NodeA with applyForce function, and i want NodeB to follow NodeA (be at the same place as NodeA). Both bodies are dynamic. My code:
-(void) update:(CCTime)delta
{
NodeB.position=NodeA.position;
}
It is OK when NodeA is not moving, but it start moving NodeB follows but positions are not exactly the same. Seems like it setts position with delay.
I've tried also Pivot Joint but result is almost the same.
Please help me if You know where is the problems.
Thanks!
I am using cocos2d v3.2 with Chipmunk, here is my problem:
There are two nodes with bodies ( NodeA, NodeB). I am moving NodeA with applyForce function, and i want NodeB to follow NodeA (be at the same place as NodeA). Both bodies are dynamic. My code:
-(void) update:(CCTime)delta
{
NodeB.position=NodeA.position;
}
It is OK when NodeA is not moving, but it start moving NodeB follows but positions are not exactly the same. Seems like it setts position with delay.
I've tried also Pivot Joint but result is almost the same.
Please help me if You know where is the problems.
Thanks!