Skip to content

Instantly share code, notes, and snippets.

@myxyy
Last active May 14, 2023 02:32
Show Gist options
  • Save myxyy/67b7a0793118f2f9443787fb2e348861 to your computer and use it in GitHub Desktop.
Save myxyy/67b7a0793118f2f9443787fb2e348861 to your computer and use it in GitHub Desktop.
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