How to make child reset to original position if parent re-active ? (everytime 'SetActive (true)')

Hi… I have 1 script c# put at Enemy… My problem is when enemy1 or 2 or 3 back to active, child not reset to original position. Child have rigidbody and collider. Can somebody help me to reset to original position? this script are inside ‘Enemy’…

Somebody !!! Help me please… :wink: - I’m new in UNITY and C# -

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class EnemyList : MonoBehaviour {

public GameObject[] enemys;
public int currentEnemyIndex;

IEnumerator Start (){   
	LoadEnemy ();
	yield return 0;
}
	
private void BackToMenu (){
	Application.LoadLevel ("Menu");
}

public void LoadNextEnemy () {
	if (currentEnemyIndex == enemys.Length - 1) {
		currentEnemyIndex = 0;
		Application.LoadLevel ("Menu");
	} else if (currentEnemyIndex >= 0 && currentEnemyIndex < enemys.Length - 1) {
		currentEnemyIndex++;
		LoadEnemy ();
	}
}
	
//Load the previous enemy
public void LoadPreviousEnemy () {
	if (currentEnemyIndex > 0 && currentEnemyIndex < enemys.Length) {
		currentEnemyIndex--;
		LoadEnemy ();
	}			
}
	
//Load the current enemy
private void LoadEnemy () {
	if (enemys == null) {
		return;
	}			
	if (!(currentEnemyIndex >= 0 && currentEnemyIndex < enemys.Length)) {
		return;
	}			
	if (enemys [currentEnemyIndex] == null) {
		return;
	}
	HideEnemys ();			
	enemys [currentEnemyIndex].SetActive (true);
}
	
//Hide the enemys
private void HideEnemys (){
	if (enemys == null) {
		return;
	}
	foreach (GameObject enemy in enemys) {
		if (enemy != null)
			enemy.SetActive (false);
	}
}

}

You could reset the position using the function OnEnable Unity - Scripting API: MonoBehaviour.OnEnable()

void OnEnable()
{
    // transform.localPosition = Vector3.zero;
}

And if you want to differentiate between re-activation and first time you could use Awake() as well.

Vector3 originalPosition;

void OnEnable ()
{
transform.localPosition = originalPosition;
}

void Awake ()
{
originalPosition = transform.localPosition;
}

See OnEnable, Awake, Start order - Unity Answers for the order of functions being called.