Disconnecting while calling an RPC

Options
Hello there!

I am working on a 2D multiplayer game but I'm fairly new to Photon. So...
I want the player sprite to flip and I am doing that by creating an PunRPC method with the flipping code in it.
Now I call this method in the update function like this:
photonView.RPC("TestPun", PhotonTargets.AllBuffered);

There is a photonView component attached to the object.
But everytime I start the game i disconnect within a few seconds. Even if there is nothing written in the method.
If don't call the RPC everything works fine..

Thank you for your help and if you need more information I'll provide them asap!

Best Answer

  • Smaex
    Smaex
    Answer ✓
    Options
    Okay I solved it myself and this might be the biggest beginner mistake of all time but here it is. Maybe this will help other beginners running into this:

    rpc events are NOT meant to be called every frame. Obviously this will end up in a disconnect... :D

Answers

  • Smaex
    Smaex
    Answer ✓
    Options
    Okay I solved it myself and this might be the biggest beginner mistake of all time but here it is. Maybe this will help other beginners running into this:

    rpc events are NOT meant to be called every frame. Obviously this will end up in a disconnect... :D