Quantcast
Channel: Multiplayer
Viewing all articles
Browse latest Browse all 16796

Deal with Cmd and Rpc functions delay.

$
0
0
I'v noticed when I'm running functions like Cmd and Rpc they won't execute on the same frame they called in.

example:

Code (CSharp):
  1. int x = 1;
  2.  
  3. void foo()
  4. {
  5.     Rpc_ChangeValue();
  6.     print(x) //prints 1
  7. }
  8.  
  9. [ClientRpc]
  10. Rpc_ChangeValue()
  11. {
  12.     x=2;
  13. }
  14.  
If this is the case, is there a way to deal with it with a coroutine?

something like:

Code (CSharp):
  1. IEnumerator foonumerator()
  2. {
  3.     yield Rpc_ChangeValue(); //If it would work it would be great.
  4.     print(x);
  5. }
For now i'm...

Deal with Cmd and Rpc functions delay.

Viewing all articles
Browse latest Browse all 16796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>