unity respawn

Code Example - unity respawn

                
                        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);
     }
 }
                    
                
 

unity mouse lock

                        
                                Cursor.lockState = CursorLockMode.Locked;
                            
                        
 

Related code examples