// Use this for initialization void Start() { control = GetComponent <CharacterController>(); control.enabled = true; coroutine = DoCheck(); StartCoroutine(coroutine); BGM = GameObject.FindWithTag("GameController"); brainOfPain = BGM.GetComponent <PainScript>(); rotation = transform.rotation.eulerAngles.y; animCtrl = harry.GetComponent <Animator>(); }
public void Touch() { if (action == null) { //Debug.Log("Touched"); } else { if (action == "pain") { System.Random r = new System.Random(); int rInt = r.Next(0, 2); //Debug.Log("Num: " + rInt); if (rInt == 0) { //Debug.Log("Pain"); GameObject tmpScript = new GameObject(); PainScript ps = tmpScript.AddComponent <PainScript>(); tmpScript.transform.parent = GameObject.Find("Tmp").transform; } } } }