Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UdonSharp;
- using UnityEngine;
- using VRC.SDKBase;
- using VRC.Udon;
- public class audiooverrideudon : UdonSharpBehaviour
- {
- Collider m_collider; //Needs to be placed on a gameobject with a trigger collider
- public float maxDistance ;
- public float defaultDistance ;
- // Use this for initialization
- void Start () {
- m_collider = GetComponent<Collider>();
- }
- //SOS Audio Overrides
- //Note you need to place these without the players being in them at spawn
- public override void OnPlayerTriggerEnter(VRCPlayerApi player)
- {
- player.SetVoiceDistanceFar(maxDistance);
- player.SetAvatarAudioFarRadius(maxDistance);
- }
- public override void OnPlayerTriggerExit(VRCPlayerApi player)
- {
- player.SetVoiceDistanceFar(defaultDistance);
- player.SetAvatarAudioFarRadius(defaultDistance);
- }
- }
Add Comment
Please, Sign In to add comment