#Need help with this
private var collided = false;
function OnCollisionEnter(){
if (!collided){
collided = true;
StartCoroutine(PlayAndDisappear());
}
}
// play and disappear after delay:
function PlayAndDisappear(){
GetComponent.().Play("321go");
WaitForSeconds(4){
(GetComponent.()["321go"]);
}
gameObject.SetActive(false); // deactivate object
}
I'm using this script to try to delete an animation (countdown from 3) after it hits Go so that it doesn't just take up the screen after hitting 3. Using the following script I am getting this error:
Assets/fuckingballs.js(15,4): BCE0038: 'UnityEngine.WaitForSeconds' is not a valid macro.
Could anyone here tell me how to fix the code? Thank you!
↧