“The body of ‘_Playanim.OnCollisionEnter(Collision)’ cannot be an iterator block because ‘void’ is not an iterator interface type”
Gives out this error when i add wait for seconds function
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class _Playanim : MonoBehaviour
{
public GameObject quad;
[SerializeField] private Animator Myanimator;
private void OnCollisionEnter(Collision other)
{
if (other.gameObject.tag == "rigidpencil")
{
Myanimator.SetBool("_play", true);
quad.SetActive(true);
yield return new WaitForSeconds(60);
Myanimator.SetBool("_playreverse", true);
}
else
{
Myanimator.SetBool("_play", false);
}
}
}