How to create channels?

Hello, I'm trying to use channels within PUN to separate different sequences of traffic during OpRaiseEvent, etc. But I run into this error:

Cannot send op: Selected channel (3)>= channelCount (2).

Where do I setup the channelCount in the first place? Do I need to preallocate some number of channels? If so, where do I do that? Thanks!

Comments

  • You need to set networkingPeer.ChannelCount in PhotonNetwork. There is no property for this at the moment (as it's rarely used and we try to keep PUN simple).
    Do this before you connect and it will be fine. A call to PhotonNetwork.SwitchToProtocol() will reset the value to default = 2 channels.