How to assign an Prefab to MainBody using script

Hello, how can i manage to assign a object to the Main Rigid body in C#? I try to assign a prefab to the main body;

    public Engine[] engineArray;
    public Engine leftThrt;
 	public Engine righttThrt;
    engineArray = Object.FindObjectsOfType(typeof(Engine)) as Engine[];

i used this statement to populate the array with all my engines it works fine, but how do i manage to select specific engine
i tried

leftThrt = GameObject.FindGameObjectWithTag("LeftThr");

but it obvious give an error Cannot convert gameobject to Engine…

With all your engines within the engineArray, why don’t you just iterate through all of them and identify which one is what?

foreach(Engine i in engineArray)
   if(i.value == someCondition)