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