Photon Networking 2 - RaiseEvent

Поделиться
HTML-код
  • Опубликовано: 12 янв 2025

Комментарии • 47

  • @Dom-wv9zm
    @Dom-wv9zm 3 года назад +3

    HA! Thank you for this video, literally provided a perfect solution with zero issues. I was able to create a 4 directional top down multiplayer system using this. Thanks again!

  • @aussieraver7182
    @aussieraver7182 2 года назад

    This is the missing link!
    I have a procedurally generated suburb, and each house has a photon view because clients can interact with the doors (sync open/close door on the network).
    I would have over 1000+ photon views (one for each house), surpassing the MAX_VIEW_IDS.
    Thanks so much!

  • @Кирилл-с3п9у
    @Кирилл-с3п9у 2 года назад

    This method is the bomb , thanks for the code and explanations . Good luck

  • @jmarsh411
    @jmarsh411 Год назад

    Brilliant explanations, thank you!!

  • @sinuquinha.brasil
    @sinuquinha.brasil Год назад

    In a specific game I need to send the Position, Speed ​​and Angular Speed ​​of the objects. However, it can cause an overload causing constant photon disconnections. If I use ByteArraySlice can it resolve the disconnections?

  • @AssassinateThisEzio
    @AssassinateThisEzio 2 года назад +1

    Anyone know how to fix the CS0121 error I have for the RaiseEvent? The code is the exact same as in the video and in the documentation and I have the ExitGames.Client.Photon namespace.

  • @batrox9219
    @batrox9219 3 года назад

    at 7:40 when i copy this line 62, i get the error "error CS0103: The name 'RaiseEventOptions' does not exist in the current context". Does anyone know how to fix that?

    • @clastergaming6394
      @clastergaming6394 3 года назад +2

      Right click on it press the lightbulb icon then it shows the necessary libraries you need to use

  • @chaostellar
    @chaostellar 4 года назад +2

    I'am getting this The type or namespace name 'EventData' could not be found (are you missing a using directive or an assembly reference?)

  • @stredo6683
    @stredo6683 2 года назад

    i was having some trouble with the object array, if someone is having the same problem, try using a float array instead, it worked for me!

  • @rodrigo.cs.machado
    @rodrigo.cs.machado Год назад

    Perfect tutorial! I loved your content, I'm having problems creating a laser, which all players have, I'm not able to activate a player's laser so that others can see. Either the player activates everyone's, or nothing happens. I'm very frustrated with this

  • @ethereal1444
    @ethereal1444 3 года назад

    I'm trying to flip the sprite of my weapon when it rotates below some angle. It works fine locally but how do I sync this on all clients. I've tried RPC and OnPhotonSerializeView but couldn't get it to work. Need help :(

  • @gameplay_factory
    @gameplay_factory 2 года назад

    is there any way to convert those" object[] " definiton to custom classes like DataClass ?

  • @ashadodhiawala5039
    @ashadodhiawala5039 4 года назад +1

    Can you explain when to use RPC and raise event as if what makes them different apart from reliable and non reliable but which information should be sent through RPC and which through event

    • @FirstGearGames
      @FirstGearGames  4 года назад +1

      Rpcs are always reliable but not everything needs to be sent reliably. Sometimes you may want to send things like visual effects as non reliable which won't matter if they're dropped.

    • @ashadodhiawala5039
      @ashadodhiawala5039 4 года назад

      @FirstGearGames so as per my understanding if we have some effects like boom explosion or changing the flag color etc we can use events but if we want to send if the client shoot the gun or client died or spawn etc we can HAVE to use RPC

    • @FirstGearGames
      @FirstGearGames  4 года назад

      @@ashadodhiawala5039 you could run shooting as an event though but it may drop. Otherwise yes.

    • @zackng9544
      @zackng9544 2 года назад

      @@FirstGearGames Hi thanks for the tutorials.
      What do you mean by "drop"?

  • @maheshnainar8576
    @maheshnainar8576 3 года назад

    I need to load a scene for all clients using Raise Event how could I do that

  • @melanieviel69
    @melanieviel69 4 года назад +1

    Would be great if you zoomed in. 125% zoom on the IDE makes it hard to see

    • @FirstGearGames
      @FirstGearGames  4 года назад +1

      This series has already been completed but I'll be sure to check my zoom levels in future videos. Thanks.

    • @96698041
      @96698041 4 года назад

      Agree!

  • @ancolia8772
    @ancolia8772 2 года назад

    Hello, when the photon room has no players, do the events still remain?

  • @usergls869
    @usergls869 4 года назад

    Does it work for movement?I have character that move ,and i applied this script to my character,and when masterclient moves,other client moves too,but it moves twitchy.

  • @Bhavin_Lathia
    @Bhavin_Lathia 4 года назад

    For me raise events or RPC both won't work properly on standalone builds and i have no freaking Idea why! I was suspicious as I was using only one photonView because i just want to transmit data and no move anyone. But, you did exactly what i wanted and it worked for you.
    The raise events work great when called from Unity editor but, won't work if called from standalone.

  • @luisalbertoherediaaramburo9143
    @luisalbertoherediaaramburo9143 4 года назад

    How can I do the same, but for everyone to be able change the color?
    Im making a card game an only the creator can move the cards :(, i don´t want that

  • @MFBBSubEsp
    @MFBBSubEsp 3 года назад

    its a great video really, but I have a certain doubt, why cant we use the raiseevent in the masterclient? I know its limited to that user who has the photonview ownership but the masterclient should also have one or... well, I think it has one

  • @lemmysnickers
    @lemmysnickers 4 года назад

    Thanks for this! Lifesaver!

  • @nuramiera4373
    @nuramiera4373 5 лет назад +1

    Is it possible to make 2 player control the same object at the time ?

    • @FirstGearGames
      @FirstGearGames  5 лет назад +1

      I've honestly never tried. You can have two players try to execute RPCs or sync variables at the same time without using IsMine checks. Results could be unpredictable. May be better to have another player request actions on the owning player rather than just trying to perform them.

  • @ragavendranbala2923
    @ragavendranbala2923 4 года назад

    I guess you forgot to mention that event won't wake inside the the script unless we call that manually on the sender. RPC can do that automatically, Correct me If I'm wrong

  • @shortiez3149
    @shortiez3149 5 лет назад

    Im making a building system. What would be the best way to show the built object over the network so that all players see what has been built?

    • @FirstGearGames
      @FirstGearGames  5 лет назад

      Probably RPC when the build starts. There's no reason build timers wouldn't line up; you can sync build percent if you were worried about it though.

    • @shortiez3149
      @shortiez3149 5 лет назад

      Ok I’ll try that. Thanks

  • @hermanwong5813
    @hermanwong5813 4 года назад

    how could i change a text and send it to other users by using RaiseEvent? Text cannot be a Observed Component in Photon View.

    • @jonathansaindon788
      @jonathansaindon788 4 года назад

      If you have a set of prefedined messages that do not change, you could send the id (int) of the message. If it is for chat, there is a Photon Chat asset for this on the store.

  • @naptyliusbontery4990
    @naptyliusbontery4990 4 года назад

    hi you have very good videos and im working in a game with them, thanks for all, i have a proble, if iuse "base.PhotonView.IsMine" i have errors wile im running the test, i've comented them, and is working, do you know why?

  • @princemawan8152
    @princemawan8152 5 лет назад

    Great job man thanks, but can you please tell me how can i make this for RawImage

    • @FirstGearGames
      @FirstGearGames  5 лет назад +1

      If you are trying to send an image you probably want to use a third party server for that. You can try a byte array if it's small.

  • @eiwangadoy6941
    @eiwangadoy6941 4 года назад

    I have tried to send a raiseEvent to an object a to b, debug logged every incoming event on object b. So now when i start my game, the object b says that it receives events with code 253 (photon) but when mine (with code 0) is called, the object b doesnt say anything. As if the event gets lost. I know the reason can be anything but maybe it's already happened to you so... ^^ just trying

    • @eiwangadoy6941
      @eiwangadoy6941 4 года назад

      Update : I debug logged the raise event and it returned true so... getting lost?

    • @FirstGearGames
      @FirstGearGames  4 года назад

      @@eiwangadoy6941 not likely it's getting lost unless your network is extremely unstable and you're sending unreliable. Send reliable to test and default options. If still no luck make sure you aren't using unsupported value/data types in your event.

    • @eiwangadoy6941
      @eiwangadoy6941 4 года назад +1

      @@FirstGearGames Well, i have fast internet and only sending a array of object with a single bool inside. But ima keep on digging and i'll share if I find anything, thanks for your tutorials :D

    • @eiwangadoy6941
      @eiwangadoy6941 4 года назад

      Well, according to a photon admin, raise events are only received by the other players in the room. I'm looking more deeply, i'll give a real answer later

    • @eiwangadoy6941
      @eiwangadoy6941 4 года назад +3

      For anyone who struggles :
      if (PhotonNetwork.IsMasterClient)
      {
      object[] data = new object[] { status };
      RaiseEventOptions options = new RaiseEventOptions();
      options.Receivers = ReceiverGroup.All;
      PhotonNetwork.RaiseEvent(0, data, options, SendOptions.SendReliable);
      Debug.Log("Sending event for activating cameras");
      }

  • @ski1526
    @ski1526 2 года назад

    Unity won't recognize EventData