The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Start Coroutine by RPC?

steamcore
2016-11-26 22:25:53

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
2016-11-28 09:19:45

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
2022-09-28 11:47:39

Works perfect.

Back to top