Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity gameobject teleporting

//For example
gameobject.transform.position = new Vector3(-2.29f, -1.99f, 0);
Comment

how to make teleporter in unity

//USES UNITY//
//USED FOR TELEPORTING BETWEEN SCENES//

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

 public class TeleportTrigger : MonoBehaviour
 {
      void OnTriggerEnter (Collider other) //When You Collide With Object.
   {
     if (other.gameObject.CompareTag("TeleportTrigger"))//compare tag TeleportTrigger
     {
         SceneManager.LoadScene("Your_Scene_Name_Here");
         Debug.Log("Loaded Next Scene");
         //if collide with object that has tag "TeleportTrigger"
         //then load the next scene//
     }
   }
 }
 //This Script Was Written By Person In A Place
Comment

PREVIOUS NEXT
Code Example
:: c# swap variables 
Csharp :: changing euler angles unity 
::  
::  
::  
:: c# string to hex 
Csharp ::  
::  
Csharp ::  
Csharp ::  
::  
::  
Csharp ::  
:: c# bcrypt 
:: .net core enum select list 
::  
::  
::  
Csharp ::  
::  
Csharp ::  
:: unity transparent object 
::  
Csharp ::  
:: how to store array in c# 
::  
Csharp ::  
::  
:: unity how to move an object 
::  
ADD CONTENT
Topic
Content
Source link
Name
1+7 =