Created
July 18, 2020 19:59
-
-
Save niiicolai/fea61a160f396d4d30a0cde587c3a616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Portal : MonoBehaviour | |
{ | |
[SerializeField] | |
private string playerTag; | |
[SerializeField] | |
private Portal target; | |
[SerializeField] | |
private Transform spawnPoint; | |
public Transform SpawnPoint { get; } | |
private void OnTriggerEnter(Collider other) | |
{ | |
if (other.CompareTag(playerTag)) | |
{ | |
other.transform.position = target.spawnPoint.position; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment