Last active
February 22, 2022 19:09
-
-
Save 314pies/0a190cc7b3ac17de65f2209034fbbd57 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 UpdatePlayerRespawnPoint : MonoBehaviour | |
{ | |
public Vector3 RespawnPoint; | |
private void OnTriggerEnter(Collider other) | |
{ | |
//if the enter object is the player | |
if (other.tag == "player") { | |
//Update respawn point | |
other.gameObject.GetComponent<playerRespawnScrpt>().respawnPoint = this.RespawnPoint; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment