can't access child script

This is my hierarchy panel: 34176-hierarchy.jpg
I have this script attached to my dmgCube gameObject in the hierarchy and I would like to access the Flame gameObject. I tried almost everything within my current skills :frowning:

public class DmgCube_scr : MonoBehaviour {
	
	Color originalColor;
	GameObject target;
	GameObject lastTarget;
	GameController_scr gc_scr;
	GameObject trickCube;
	public bool dmgCharged;
	Cube_scr cube_scr;
	ParticleEmitter staffLight;
	GameObject flame;


	void Awake()
	{
		trickCube = GameObject.Find ("trickCube"); 
	}

	void Start () {
		originalColor = trickCube.renderer.material.color;
		lastTarget = trickCube;
		staffLight = gameObject.transform.parent.GetComponentInChildren<ParticleEmitter>();
		// flame = gameObject.transform.parent.transform.Find("Flame").gameObject;
            // I need to have this part fixed...help pls.
		Debug.Log ("flame = " + flame.name);
		DeChargeStaff();
	}
	

	void Update () {

		// ::::::::::::::::::::::::::::::::::::::::::::::: TARGETING :::::::::::::::::::::::::::::::::::::::::::
		Ray targetingRay = new Ray(transform.position, transform.TransformDirection (Vector3.forward));
		RaycastHit targetHit;
		
		if(Physics.Raycast (targetingRay, out targetHit, 1f))
		{
			if(targetHit.transform.gameObject.tag == "cube")
			{
				target = targetHit.transform.gameObject;
				cube_scr = target.GetComponent<Cube_scr>();
				//Debug.Log ("target name = " + target.name);
				MarkTarget ();
				lastTarget = target;
			}
		}else{
			if(lastTarget != null)
			{
				lastTarget.renderer.material.color = originalColor;
			}
			else{lastTarget = trickCube;}
			target = null;
			cube_scr = null;
		}

		if(Input.GetKeyDown (KeyCode.O))
		{
			ChargeStaff ();
		}
		if(Input.GetKeyDown (KeyCode.I))
		{
			DeChargeStaff ();
		}

	}

	public void ChargeStaff()
	{
		staffLight.enabled = true;
		dmgCharged = true;
	}
	public void DeChargeStaff()
	{
		staffLight.enabled = false;
		dmgCharged = false;
	}

	void MarkTarget()
	{
		if(target != lastTarget)
		{
			target.renderer.material.color = Color.gray;
			lastTarget.renderer.material.color = originalColor;
		}
	}
	
	// ::::::::::::::::::::::::::::::::::::::::::::::: ATTACKING :::::::::::::::::::::::::::::::::::::::::::
	public void Attack()
	{
		if(dmgCharged && target != null)
		{
			StartCoroutine (CoAttack ());
		}
	}

	public IEnumerator CoAttack()
	{
		yield return new WaitForSeconds(0.35f);
		Destroy (target);
		lastTarget = trickCube;
		DeChargeStaff();

		cube_scr.CubeExplode();

	}



}

There are a variety of ways, the slowest of which being your atempt (GameObject.Find).

The fastest way is to use a straight up public reference.

public GameObject flameObject;

Now your dmgCube should have a new property. Drag the Flame game object into the new property.

The next best way is to set your Flame object to have a tag, say “Flame”

flame = GameObject.FindWithTag("Flame");

Try this:

 flame = transform.parent.Find("staff/Flame").gameObject;

You have to specify a path for Transform.Find(). If ‘Flame’ as a unique script, then you could also do:

flame = transform.parent.GetComponentInChildren<SomeClass>().gameObject;