Hi there. I'm trying to create compound body but can't set position for each part individually.
let partA = Body.Rectangle(0,0,50,50);
let partB = Body.Rectangle(0,50,50,50); // here i want to set relative position
let compound = Body.create({parts:[partA, partB]});
I my case my compound consists lot of primitive figures and after adding them they change their positions and centered to the center of total bounds of compound.
expect to see something line this

but I see like this

Body.setParts(body, parts, true||false) doesn't change the situation.
Can someone explain please, is it a bug or i'm doing something wrong. Also tried to play with constraints but the result is the same.
Thank you.
This happens because the parts are automatically adjusted to ensure that the parent body's origin body.position is at the centre of mass of all parts. So what you should do is call Body.translate(body, offset) right after creation. I realise this is not so intuitive, so I'll consider whether this can be implemented as an option to setParts that won't break too many things.
Thank you for reply.
As I understand you mean to call translate for each part after creation, right? Unfortunately doesn't helped.
Can you please demonstrate with this example https://jsfiddle.net/18ytjuom
Most helpful comment
This happens because the parts are automatically adjusted to ensure that the parent body's origin
body.positionis at the centre of mass of all parts. So what you should do is callBody.translate(body, offset)right after creation. I realise this is not so intuitive, so I'll consider whether this can be implemented as an option tosetPartsthat won't break too many things.