mmorpg/Assets/Script/teleporter.cs
2024-05-24 23:30:33 +05:30

19 lines
544 B
C#
Executable File

using System.Collections;
using System.Collections.Generic;
using JetBrains.Annotations;
using UnityEngine;
public class teleporter : MonoBehaviour
{
public Transform teleportLocation;
private void OnTriggerEnter2D(Collider2D other) {
if(other.tag == "Player"){
if(other.transform == playerNetwork.localPlayerTransform){
other.transform.position = teleportLocation.position;
cameraRPG.instance.Teleport(teleportLocation.position);
}
}
}
}