Last active
May 14, 2023 02:32
-
-
Save myxyy/67b7a0793118f2f9443787fb2e348861 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 UdonSharp; | |
using UnityEngine; | |
using VRC.SDKBase; | |
using VRC.Udon; | |
public class PlayerCollider : UdonSharpBehaviour | |
{ | |
[SerializeField] | |
private GameObject _target; | |
public override void OnPlayerTriggerEnter(VRCPlayerApi player) | |
{ | |
if (player.isLocal) | |
{ | |
_target.SetActive(true); | |
} | |
} | |
public override void OnPlayerTriggerExit(VRCPlayerApi player) | |
{ | |
if (player.isLocal) | |
{ | |
_target.SetActive(false); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment