How to Teleport in Unity | Unity Tutorial
In this Unity tutorial, I show you guys how to teleport in Unity using C#.
#Unity #Unity3D #GameDevelopment
For more Unity tutorials or more videos in-general - be sure to like, comment, and subscribe for more! 👍
Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class teleport : MonoBehaviour
{
public Transform player, destination;
public GameObject playerg;
void OnTriggerEnter(Collider other){
if(other.CompareTag("Player")){
playerg.SetActive(false);
player.position = destination.position;
playerg.SetActive(true);
}
}
}
Follow me on Twitter:
https://twitter.com/omogonix
Try out my games:
https://omogonixlachlan.itch.io
Forgehub:
https://www.forgehub.com/members/omogonix.87700/
Subscribe to my Second Channel:
https://www.youtube.com/channel/UCkylkvUtpvbHfafGfIdMLBQ/featured
Join my Discord:
https://discord.gg/a88vmGD
Facebook Page:
https://www.facebook.com/Omogonix/
Follow me on Instagram:
https://www.instagram.com/uwugonixhalo/