if actor is parent

i need a way to do this.
eg
if (actor1 is child of actor2)
{
ect ect ect
}
any ideas?
little more info.
i need it so if say the engine is attached to the car the car can move. if the engine isnt attached it wont move. but i need to be able to dublicate engine and car and if i attach the engine to 1 car only that car will move. or if i attach to both they both will move.
THEY ATTACH by if they touch each other the engine becomes a child of the car
then if i click on the engine it become not an child and falls of.
eg
if (actor1 is child of actor2)
{
ect ect ect
}
any ideas?
little more info.
i need it so if say the engine is attached to the car the car can move. if the engine isnt attached it wont move. but i need to be able to dublicate engine and car and if i attach the engine to 1 car only that car will move. or if i attach to both they both will move.
THEY ATTACH by if they touch each other the engine becomes a child of the car
then if i click on the engine it become not an child and falls of.