vrchat-community / UdonSharp

A compiler for compiling C# to Udon assembly
https://udonsharp.docs.vrchat.com
MIT License
470 stars 50 forks source link

Method is not exposed to Udon: 'Audiomixer.SetFloat(VarName,slidervalue)' #144

Open blackcat1101 opened 1 year ago

blackcat1101 commented 1 year ago

Describe the bug in detail: Audiomixer.SetFloat isnt working at all, it keeps saying Assets/map_UdonProgramSources/EQvalueset.cs(12,8): Method is not exposed to Udon: 'Audiomixer.SetFloat(VarName,slidervalue)'

Provide steps/code to reproduce the bug: have this code on a slider

using UdonSharp; using UnityEngine; using VRC.SDKBase; using VRC.Udon; using UnityEngine.Audio; public class EQvalueset : UdonSharpBehaviour { [SerializeField] private AudioMixer Audiomixer; [SerializeField] private string VarName; private void update(float slidervalue ) { Audiomixer.SetFloat(VarName,slidervalue); } }

Expected behavior: To set the audio mixers Eq gain to what ever the slider is.

Additional Information: i dont know if im just being stupid or if this hasnt been implomentded yet, but i cant even find the audio mixer value on udon graph.

jellejurre commented 1 year ago

You can check VRC SDK -> UdonSharp -> Class Exposure Tree to check whether something is exposed. I don't believe these methods are exposed by VRChat.

Actually, come to think of it, I don't even think the AudioMixer component is allowed on upload

blackcat1101 commented 1 year ago

ill check now if they allow audio mixers, i mean, im useing one right now but i dont see anything going wrong with it or even them saying anything about it, i dont see why they wouldnt be allowed for worlds.

blackcat1101 commented 1 year ago

so i took a look and yea they arent exposed, we can have them in the world by default, it dosent cause an issue, but why arent we allowed to use them in scripting, this makes no sence.