19 lines
544 B
C#
Executable File
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);
|
|
}
|
|
}
|
|
}
|
|
}
|