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

Error CS1525: Unexpected symbol `)', expecting `(', `[', or `{'

$
0
0
Hi, I've written some code which disables a script and starts a coroutine when a collision happens, but I get these two errors **Assets/Scripts/SceneDelay.cs(16,40): error CS1525: Unexpected symbol ), expecting (, [, or {** and **Assets/Scripts/SceneDelay.cs(22,4): error CS1525: Unexpected symbol `IEnumerator'** here is my code: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class SceneDelay : MonoBehaviour { public static int score = 0; public Text scoreText; private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Obstacle") { GetComponent(new ScoreScript).enabled = false; StartCoroutine(DelayLoad()); } } IEnumerator DelayLoad() { yield return new WaitForSeconds(1); SceneManager.LoadScene("Menu"); scoreText.text = 0.ToString(); score = 0; yield break; } } Both the score script and scene delay script are attached to the same object.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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