Here’s the problem: I have a figure, that has both sprite and body. This figure is dragable, and on the touch event’s Action Down I need body to be disconnected so it could not collide with other bodies while being dragged. Then on Action Up body should be connected to the sprite. There are two methods I’ve defined to solve this problem.
protected void connectBody() {
if (!bodyConnected) {
connector = new PhysicsConnector(mSprite, mBody, true, true);
mPhysicsWorld.registerPhysicsConnector(connector);
bodyConnected = true;
}
}
protected void disconnectBody() {
if (bodyConnected) {
if (connector != null) {
mPhysicsWorld.unregisterPhysicsConnector(connector);
}
bodyConnected = false;
}
}
However, this doesn’t work. When I drag the figure it collides with other figures. Can anyone help me solve this one? Thanks a lot in advance.
I played around with it couple of days ago and this was what I did to drag an object.