[Box2D] What's the best way to keep multiple colliders together when moving them manually?

I have these colliders that should be attached to a node that I can manually move in and out of the screen. I’ve tried all joints combinations and either they where unaffected and did not move or they would react independently to the parent.

Ideally I would like to have several children and their colliders grouped under a parent node but I don’t know how to do that.

One solution that works is to put all colliders on one node and move it using node.x and node.y but it doesn’t feel like the right thing to do.

Any suggestions are welcome

Thanks

I had same problem ,I solved this problem with following code:

	this.parentNode.active = false
	this.parentNode.x = newPos.x
	this.parentNode.y = newPos.y
	this.parentNode.active = true
2 Likes

Well, I’ll be damned. That actually works! How on earth did you figure that one out?

I don’t know why this code works!!:thinking::thinking::thinking:
just I got a test and error.

1 Like