- Home /
NetworkView.RPC: Can you nest RPC calls?
Something like this:
[RPC]
public void RPC_Call_1() {
//Do something...
}
[RPC]
public void RPC_Call_2() {
//Do something...
//Obtain network view
networkView.RPC("RPC_Call_1", RPCMode.All, null);
}
I am wondering if it's possible to nest RPC calls. I am not asking about code designs or anything, just asking for the possibility of nesting RPC calls. And if I can do nested RPC calls, yet my code is wrong, can you please explain the correct way of doing this?
Thanks in advance.
Answer by HuskyPanda213 · May 29, 2015 at 10:08 PM
I believe that it's fine to nest RPC calls (if necessary). The only thing that I think might be wrong - but it may just be that I do not structure my RPC calls like you - is that you are giving null as the final argument to the nested RPC call. If it works you could keep null as the last argument, but I would remove it to make the code more concise.
Okay, thanks. All I just wanted to know if RPC calls can be nested or not.
I also found my other answer here. If it wasn't for me requiring a moderator to approve my questions, I would've gotten my answers sooner. Oh well.
Your answer
Follow this Question
Related Questions
How to sync networkViewIDs 0 Answers
Network views wrong on re join to server 0 Answers
Get NetworkPlayer from ViewID 1 Answer
Pass a Transform into a Function 1 Answer
Networking: RPC To Specific Player? 1 Answer