RaiseEvent not working?
Options
Hi, I've been working on the PUN RaiseEvent Function, I completely followed the tutorial, but there is still something wrong in my script.
My script is like this:
It seems that Visual Studio can find neither RaiseEventOptions nor SendOptions. It's this because of the new update version? Appreciate your help
My script is like this:
private void InstantiateWallEvent(string name) { object[] data = new object[] { true }; RaiseEventOptions options = new RaiseEventOptions(); options.Receivers = ReceiverGroup.All; PhotonNetwork.RaiseEvent(0, data, options, SendOptions.SendReliable); }
It seems that Visual Studio can find neither RaiseEventOptions nor SendOptions. It's this because of the new update version? Appreciate your help
0
Comments
-
I'd say this is due to the namespace Photon.Realtime. You have to declare your code is using it:
using Photon.Realtime;
0 -
Hi, I tried to include Photon.Realtime. But it's said that "
The call is ambiguous between the following methos or properties: 'PhotonNetwork.RaiseEvent(byte,object,RaiseEventOptions,SendOptions)'and'PhotonNetwork.RaiseEvent(int,object[],object,object)'"
I guess there are two functions with the same name ? But I cannot find the second one in the PhotonNetwork scripts. Also I am using PUN ,why should I include Photon.Realtime?
Thanks a lot!0 -
Well, the Realtime API is used by PUN, so it may be required here and there.
What's surprising is that you end up with 2 overloads of PhotonNetwork.RaiseEvent.
It only has this definition:
RaiseEvent(byte eventCode, object eventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions)
Maybe you update and reimport PUN via the asset store. In a few rare cases, the package that is downloaded is old and you might want to check the Assets cache.
Make sure the PhotonServerSettings show v2.18.1 when you updated.
0 -
Hi there, i have the same issue. Did you find a fix?
Thank you mate,0