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

Why do i get an error ? please help i've stuck for 20 min

$
0
0
so i'm trying to load "paused screen" whenever the user inputs(presses) the Esc. button, but then i get this error. The best overloaded method match for `UnityEngine.Input.GetButtonDown(string)' has some invalid arguments Argument `#1' cannot convert `UnityEngine.KeyCode' expression to type `string' using UnityEngine; using System.Collections; public class LevelManger : MonoBehaviour { public void loadLevel (string name) { Debug.Log("New level load: " + name); Brick.breakableCount = 0; Application.LoadLevel (name); } public void QuitRequest(){ Debug.Log("Quit Requsted"); Application.Quit(); } public void loadNextLevel() { Brick.breakableCount = 0; Application.LoadLevel(Application.loadedLevel + 1); } public void brickDestoryed() { if (Brick.breakableCount <= 0) { loadNextLevel(); } } void Update() { if (Input.GetButtonDown(KeyCode.Escape)) { Brick.breakableCount = 0; Application.LoadLevel ("Paused"); } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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