Hi, a script that we haven't touched for some time is now giving us the following error. The code essentially looks like this. Code (csharp): function Update () { // ... stuff networkView.RPC( "RPCNewWindHeading", RPCMode.Others, currentHeading ); } @RPC function RPCNewWindHeading( heading : float, info : NetworkMessageInfo ) { Debug.Log( "In New Wind Heading" ); } Any thoughts?
Bump. We were able to correct this problem by moving scripts to the Standard Assets folder, but the problem has returned. Could this be a problem with interplay between .js and .cs scripts? Any developers that can weigh in on what this error message means? I just can't find any hints as to what I'm supposed to do about this.
I've found a work-around to the problem. But unfortunately it is done by removing the script, and its references from all assets, then re-introducing the script to the engine (Un-install and re-install). This suggests to me that something is being corrupted in the asset database, since simply re-importing the scripts doesn't seem to do anything. Has this, or something similar, happened to anyone else? Are there any less destructive ways to repair the project when it happens?
It sounds like you found the solution to the problem, which I myself ran into last week, with .cs and .js files trying to talk to each other. Here is the link to the Script Compilation in the documentation. Perhaps it may help, if not in this situation, than in later ones. Hopefully it'll shed light onto a solution which won't require you to constantly uninstall, reinstall.
The script compilation order I'm quite familiar with, but it's really random to have scripts start complaining about RPC calls (especially since the rpc calls are local to the script, and in some instances those scripts don't rely on other scripts at all) when 'nothing' has been done to them. Of course things are changing in the project all the time, but nothing I can get a direct cause and effect relationship out of yet.
I've not been able to track this one down. I'm not using any JS code in my game. Edit: it happens if you ever have a script that has a classname that is not the filename (since 2.6)
Hello, any more info on how to fix this error? I've started getting it and I have no idea why I've started getting it
I'm not... I think I might be using one C# script (to create a two dimensional array) and that's already in the standard asset folder. And isn't used with the RPC script in question anyway... I can post up the code when I get home if that helps...? it's an infuriating problem any other suggestions?
I saw the same error within a pure c# project, the issue in my case was that there was another function within another behavior that had the same name, the documentation states that the name of the called method has to be unique accross all behaviors, otherwise another function might get called. If this other function does not have the RPC Attribute set you will see the totally unhelpful error message see http://unity3d.com/support/documentation/ScriptReference/NetworkView.RPC.html
somnetimes it won't work too because you probably need a networkview that doesn't watches anything and nothing for the syncronization
Wow thanks, that was my problem solution! I had a StartGame function in one of my scripts, and I had it in another one with [RPC] too, there was errors for RPC even when the first script was not in the scene! I renamed it and it`s solved now, thanks