I've been trying to create a script and this error keeps coming up on line (22,42).
public class TRIGGERTEXT : MonoBehaviour
{
public Image ScaryImage;
public AudioSource JumpMusic;
void Start()
{
GetComponent().enabled = false;
}
void OnTriggerEnter(Collider other)
{
if(other.CompareTag("Player"))
{
ScaryImage.enabled = true;
GetComponent().PlayOneShot(JumpMusic);
yield return new WaitForSeconds(1);
GameObject.ScaryImage.Destroy;
}
}
}
Any clue what I'm doing wrong and how to fix it?
↧