Find Define GameObject Problem.

Ok another noob problem, hopefully.

I need to define a GameObject by finding it in another object. However it says I can’t, not Implicitly something error.

Code:

public GameObject turret;   
private GameObject turCamera;

void Start(){

  
   turCamera = turret.transform.Find("turretCamera");



}

What I do wrong?

Probabbly you can do it like

turCamera = gameObject.FindWithTag("example").transform;

or

turCamera = gameObject.Find("turretCamera").transform;

Transform.Find() returns a Transfom and you can’t implicitly convert a Transform to a GameObject.

Try this:

void Start() {
  Transform tf=turrent.transform.Find("turrentCamera");
  if (tf)
     turCamera=tf.gameObject;
}