Start Coroutine by RPC?

Options
Is it possible to start a coroutine the same way as a regular method in C# using RPC? Do I follow the same syntax?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @steamcore,

    Yes that should be possible using same syntax. Example:
    public class ExampleMonoBehaviour: MonoBehaviour {
    
    [PunRPC]
    public void ExampleRPC(){
        StartCoroutine("ExampleCoroutine");
    }
    
    IEnumerator ExampleCoroutine(){
        yield return null;
    }
    
    }
  • redi
    Options

    Works perfect.