Answers for "how to make character respawn if touches sprite c#"

C#
0

how to make character respawn if touches sprite c#

using UnityEngine;
 using System.Collections;
 
 public class respawn : MonoBehaviour {
     public float threshold;
 
     void FixedUpdate () {
         if (transform.position.y < threshold)
             transform.position = new Vector3(0, 0, 0);
     }
 }
Posted by: Guest on September-18-2021
0

how to make character respawn if touches sprite c#

//in your character create a new script then put this

 using UnityEngine;
 using System.Collections;
 
 public class respawn : MonoBehaviour {
     public float threshold;
 
     void FixedUpdate () {
         if (transform.position.y < threshold)
             transform.position = new Vector3(0, 0, 0);
     }
 }
Posted by: Guest on September-18-2021

C# Answers by Framework

Browse Popular Code Answers by Language