- Home /
Overloading RPCs
I'm attempting to use overloading for RPC functions. The script compiles fine (javascript), but results in an error while running when I call the overloaded function.
The fact that there isn't a compiler objection suggests to me that RPC overloading is meant to work. Has anyone managed to get this working?
I am having the same issues. I have a couple of RPC functions that I would like to overload but I get an error durring run time. Something about RPC called failed because the number of supplied parameters doesn't match the rpc declaration. but I have an RPC call with the same number of parameters.
Did you find a solution?
Nope, I could never really get it to work (I filed a bug report, but as with nearly all Unity bug reports it's just sitting untouched, marked open). In the end I think I just created a load of RPC functions with slightly different names. :(
RPCs aren't really managed by the compiler, since they're always called using string literal lookups- the compiler doesn't know anything about them! It's not exactly a bug, and the fact that the compiler doesn't object to it doesn't mean it's supposed to work.
Did you put the RPC tag on each method? Only on the parent method? Only on the overloaded method?
You can't overload RPC function at all! It's one of the downsides of them...
Answer by Benproductions1 · Apr 09, 2013 at 02:35 AM
Hello,
Sadly, as of yet, RPC functions cant be overloaded. As a workaround, you can overload a normal function and then call 2 different RPC's where appropriate.
Hope this helps, Benproductions1
Your answer
Follow this Question
Related Questions
Total Message Bytes Queued? 3 Answers
Networking Error! 0 Answers
OnSerializeNetworkView issus in my 2D game 3 Answers
Networked Animations Play Partially Or Not At All 0 Answers
RPC not sending and not giving an error? 0 Answers