using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class Lava : MonoBehaviour { public Health health; // Start is called before the first frame update private void OnTriggerEnter(Collider c) { // insta kill player when touching lava if (c.gameObject.tag == "Player") { SceneManager.LoadScene("DeathScreen"); } } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter