//main body action
action body_action()
{
//msc codes here
code...
//create child entity
ent_create(part1, pos_parentoffset, child_action); //point me as parent entity
//rest of the child entity code
code...
}
//child body action
action child_action()
{
//msc codes here
code...
ENTITY* parent_ENT = you;
while(1)
{
//parent_ent pointing to main body
vec_set(my.x, parent_ent.x);
wait(1);
}
}