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

Need help with a error code CS0236

$
0
0
I'm new to programming and unity and it keeps replaying this error code CS0236, for reference this is my code: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class Safe_Zone : MonoBehaviour { public float limitTime; float unsafeTime = limitTime; bool reached; void Update () { if (reached) { unsafeTime = limitTime; } else { unsafeTime -= Time.deltaTime; } if (unsafeTime <= 0f) { void OnTriggerEnter(Collider other) { SceneManager.LoadScene(1); } } }//Do something like destroy the player or show the gameover text, ... void OnTriggerEnter2D (Collider2D other) { if (other.gameObject.tag == "Player") { reached = true; } } void OnTriggerExit2D (Collider2D other) { if (other.gameObject.tag == "Player") { reached = false; } } } I'm trying to make where every ten seconds the player is transported into the game over scene, unless he is in a safe zone, I'm out of ideas to solve this.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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