First things first, yes, I have scoured this and many other sites to find out what I’m doing wrong, but I’ve come up with now answers. I’m doing a fairly easy script (based off of other tutorials) as I’m trying to get familiar with the code. I’m doing something wrong, I just can’t figure out what.
using UnityEngine;
using System.Collections;
public class ACTING : MonoBehaviour {
public Transform box;
public bool readynow;
void Start (){
}
void Update (){
if(readynow){
MakeBox();
}
}
void MakeBox(){
readynow = false;
Instantiate (box, transform.position, transform.rotation);
StartCoroutine(Timing(5.0f));
readynow = true;
}
IEnumerator Timing(float timeToWait) {
yield return new WaitForSeconds(timeToWait);
}
}
Thanks in advance for any help.