Unity Netcode asks me for adding a ServerRPC suffix AFTER the method that i want to make as a ServerRPC

141 Views Asked by At

i need some help with NGO.

I wrote a method and added a [ServerRPC] attribute (didn't forget about NetworkBehaviour instead of MonoBehaviour)

[ServerRpc]
        public void ServerSpawnBlue(Vector3 pos)
        {
        GameObject newBluCube = Instantiate(BlueCube, pos, Quaternion.identity, playerParent);
        newBluCube.GetComponent<NetworkObject>().Spawn();
        }

MS Visual Studio has no complaints with it...

But Unity asked me for some sick idea.

enter image description here

I made it just to try, but of course it didn't work.

public void ServerSpawnBlue(Vector3 pos)
        {
        GameObject newBluCube = Instantiate(BlueCube, pos, Quaternion.identity, playerParent);
        newBluCube.GetComponent<NetworkObject>().Spawn();
        }
        [ServerRpc]

enter image description here

What is this? A package bug? Compatibility error(impossible, because i imported it from package manager)? What should i do with this problem?

I cleaned library of project, i reipmorted the NGO package, but nothing helped.

0

There are 0 best solutions below