+ 2

C# help

Error: Error CS0201 Only assignment, call, increment, decrement, and new object expressions can be used as a statement The file in which this is happening: using System.Collections; using System.Collections.Generic; using UnityEngine; public class EndTrigger : MonoBehaviour { public GameManager gameManager; void OnTriggerEnter () { gameManager.LevelComplete; } } And GameManager (The file I am referencing): using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class GameManager : MonoBehaviour { bool gameHasEnded = false; public float restartDelay = 1f; public void EndGame () { if (gameHasEnded == false) { gameHasEnded = true; Debug.Log("Game Over"); Invoke("restart", restartDelay); } } void restart () { SceneManager.LoadScene("Level 1"); } public void LevelComplete () { Debug.Log("Level Finished"); } }

31st Jan 2018, 8:54 AM
Rislim
Rislim - avatar
1 Answer