Skip to content

Instantly share code, notes, and snippets.

@niiicolai

niiicolai/Portal.cs

Created Jul 18, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.