Navigation

VRC0019: NetworkCallableAttribute must be required for calling method via SendCustomNetworkEvent with parameters

Property Value
ID VRC0019
Category Usage
Severity Error
Runtime Version 3.8.1 ~ latest

NetworkCallableAttribute must be required for calling method via SendCustomNetworkEvent with parameters

Example

Code with Diagnostic

using UdonSharp;

using VRC.SDK3.UdonNetworkCalling;
using VRC.Udon.Common.Interfaces;

class TestBehaviour : UdonSharpBehaviour
{
    public void TestMethod()
    {
        SendCustomNetworkEvent(NetworkEventTarget.All, "SomeMethod", 1);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    }

    public void SomeMethod(int value) { }
}

Code with Fix

using UdonSharp;

using VRC.SDK3.UdonNetworkCalling;
using VRC.Udon.Common.Interfaces;

class TestBehaviour : UdonSharpBehaviour
{
    public void TestMethod()
    {
        SendCustomNetworkEvent(NetworkEventTarget.All, "SomeMethod", 1);
    }

    [global::VRC.SDK3.UdonNetworkCalling.NetworkCallable]
    public void SomeMethod(int value) { }
}