Check out example codes for "respawn ontriggerenter unity code". It will help you in understanding the concepts better.

Code Example 1

var spawn : GameObject;    function OnTriggerEnter(other : Collider) {     if (other.tag == "FirstPerson-AIO")     {         other.gameObject.position = spawn.transform.position;     } }

Learn ReactJs, React Native from akashmittal.com