Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to make a respaen script in unity

//Unity//
//You Can Change "void Update" to "OnTriggerEnter (Collider other)" and compare tag to something like "RespawnTrigger"  

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class Respawn : MonoBehaviour
{
    void Update()
    {
       if (Input.GetKeyDown(KeyCode.R))
       {
           SceneManager.LoadScene("123");
           Debug.Log("Respawned");
       }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity run all interfaces 
Csharp :: does Registry.CurrentUser.OpenSubKey create the key if it does not exist? 
Csharp :: split nullable in c# 
Csharp :: unity follow object 
Csharp :: c# extract after what is 
Csharp :: dapper execute with list of ids 
Csharp :: how to make dobuble jump unity 2d 
Csharp :: C# bitwise complement 
Csharp :: Stop Unity Wait Time with Button 
Csharp :: join 2 list rows into one row and add totals fields C# 
Csharp :: how can i only show just a part of alist in datagridview in c# 
Csharp :: dfgf 
Csharp :: distinct and not null c# 
Csharp :: and in c# 
Csharp :: unity wheelcollider antiroll 
Csharp :: xamarin xaml viewmodel 
Csharp :: C# if...else if Statement 
Csharp :: Runtime.getRuntime().addShutdownHook(printingHook); c# 
Csharp :: C# Printing Variables and Literals using WriteLine() and Write() 
Csharp :: Conditional IQueryable Linq extension 
Csharp :: how to split a string in f# 
Csharp :: changing color of material of renderer with multiple materias 
Csharp :: windows form toolbox enter key 
Csharp :: how to make infinite loop in c# 
Csharp :: string methods in c# 
Csharp :: unity iOS app rating widget 
Csharp :: leantween move ui 
Csharp :: unity getcomponent transform.position 
Csharp :: c# MD5.Create returning nul 
Html :: html grundgerüst 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =