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

"Can't convert type float to string"

$
0
0
Hi, I am trying to make a simple game, but it keeps giving me this error: Assets\Scripts\NextLevel.cs(22,32): error CS1503: Argument 1: cannot convert from 'float' to 'string' using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class NextLevel : MonoBehaviour { private float level = 0f; void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { ChangeLevel(); } } void ChangeLevel() { level += 1f; SceneManager.LoadScene(level); } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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