Hi all,
The following script is using a coroutine to pause for 2 seconds
and then do GameObject.FindWithTag. Doesn’t appear to be working, any thoughts?
Thanks,
Greg
using UnityEngine;
using System.Collections;
public class DisableScript : MonoBehaviour {
IEnumerator wait()
{
//Do whatever you need done here before waiting
yield return new WaitForSeconds (2f);
//do stuff after the 2 seconds
}
void Update()
{
StartCoroutine("wait");
GameObject varGameObject = GameObject.FindWithTag("MainCamera");
varGameObject.GetComponent<CameraShake>().enabled = false;
}}