I use Part.Detach() command to detach a part from a mechanism. However, the part always goes back to its original position instead of where it is carried by the mechanism to when it is detached.
Can I somehow keep the part where it is after detachment?
Hi
You need to record the position before you detach and the apply it to your part.
Something like this
// prt is the part you want to attach
//mech is what you attach the part to (in this case a robot)
Matrix4 pos = prt.Transform.GlobalMatrix;
mech.GetFlanges()[0].Detach(prt);
prt.Transform.GlobalMatrix = pos;
Basically it works like this
When you attach something for example a part to a robot mechanism it will use the part’s coordinate system. So if you want to have offset you need to move the body’s in the part relative to the part to get an offset.