From this example you can drag around(not at the draggable point but some factor) a BodyComponent by setting body.applyLinearImpulse
.
If I try to drag around, setting body.position
I get no effect. I was hoping to be able to drag the BodyComponent around at the specific drag point.
Sample code line 37:
@override
bool onDragUpdate(DragUpdateInfo info) {
// final worldDelta = Vector2(1, -1)..multiply(info.delta.game);
// body.applyLinearImpulse(worldDelta * 1000);
body.position.setFrom(info.delta.game);
return false;
}
You should never manipulate body.position
directly, since that could break the stability of the physics engine.
For your use-case you probably want to use a MouseJoint
instead: