Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement

$
0
0
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?

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>