HOW TO SETUP A MULTIPLAYER DEATH COUNT - UNITY

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

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

  • @sclexz
    @sclexz 5 лет назад +2

    Hey Welton! I finally started using your tutorials! (like 2 weeks ago but ok) Anyway, I wanted to give you some ideas for some other tutorials! Time till a match ends/kills till a match ends, teams (think I saw a comment about that), lag compensation (photon has doc on that but it would be cool if cover it) maybe a better menu. I know is just a simple tutorial to show the basics but just in case you are running out of ideas there's some!

  • @skiffman7080
    @skiffman7080 4 года назад +18

    To anybody having trouble out there: I had trouble getting RaiseEvent to trigger OnEvent, found out you need to register each object to get the event handler callback by adding these two functions at the top of your Manager script:
    public void OnEnable()
    {
    PhotonNetwork.AddCallbackTarget(this);
    }
    public void OnDisable()
    {
    PhotonNetwork.RemoveCallbackTarget(this);
    }

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

      ah thanks so much

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

      thanks a lot

    • @razprogaming-rpg7165
      @razprogaming-rpg7165 4 года назад

      Thank you I saw your comment I was struggling i didn't understand why the information wasn't receiving

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

      I have been pulling the code apart, trying to debug this for hours now! Thank You so much for finding that and commenting! absolutely saved my day!!!

  • @Tracks777
    @Tracks777 5 лет назад +3

    amazing stuff

  • @Tracks777
    @Tracks777 5 лет назад +2

    lovely content

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

    Hi bro, I hope you make a video about matchmaking :)
    P.S. Your channel is the best on the PUN 2 on unity3

  • @jackjoseph12
    @jackjoseph12 5 лет назад +4

    Love your vids. Can you do a tutorial on a settings menu?

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

    Hey! I got one question. Why wouldn't you just set this stats as a PlayerCustomProperty. Or is that not a good idea?

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

    Hi Bro, I got an Error: ArgumentNullException: Value cannot be null. Parameter name: key(referring to Spawn() and Start() function) I don't know what to do, but I coded everything that you have done in the tutorial. All my UI worked, but after clicking Create (in Create Room) I was not able to play. Another thing was, I was not able to get any room list (Room List) even after I created a Room (there was no button popped up like yours in Room List in tutorial 45). Got any idea how to get rid of this Error? please help me out, Bro.

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

      same here

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

      @@neozoido Hey Hi, go to your Map > Manager(Gameobject), in the Inspector fill the empty Player_perfab_string with your Player prefab's name and drag and drop the Player prefab in Player_prefab. This worked for me!

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

      Try it out Bro...

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

      @@punisherioi yeah I figured it out

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

      @@punisherioi thanks anyways!

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

    bro every one of ur videos i was able to understand but this gets over my mind i can copy the code but i cant understand this if someone can give me a link for a deep explaination about this it would be great edit no need now spent alot of time digging everything in it and got a good knowledge now

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

    Just in case someone is adapting this for their own game. Since the ChangeStat functions use byte for their actor and amt variables, you will only be able to send a packet of up to 255 per variable. So you can only update 255 variables to a max value of 255. Meaning, if you have a game where someone has over 255 kills, it will break this script unless the type is updated from a byte to a short or larger. Also, the byte type is unsigned, meaning that you can't send negative values

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

      Also, for funsies, the actor is saved with an int variable which is a signed 32-bit variable, so you can have a minimum of -2,147,483,648 players and a maximum of 2,147,483,647 players in a room.

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

    After my player dies nothing happens no debug.log help?

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

      public void OnEnable()
      {
      PhotonNetwork.AddCallbackTarget(this);
      }
      public void OnDisable()
      {
      PhotonNetwork.RemoveCallbackTarget(this);
      }

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

      again DONT workin

  • @henrikp.lnningdal4766
    @henrikp.lnningdal4766 5 лет назад +2

    Can you make a tutorial on how to add sound when your dying or walking? Love your vids btw

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

      that's something that there are already tutorials for, you just have to integrate them into this project. It shouldn't be too hard, just tell it to play a sound if the player has died, or if he is walking.

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

      Add a sound source to your player or use an existing one. [SerializeField] or public an AudioSource variable and an AudioClip variable to target it in the inspector, and then in the script call:
      varToAudioSource.clip = varToSoundFile;
      varToAudioSource.Play();

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

    A late night installment 🤩🤩

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

    Thank you nice Video

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

    Loot drop after death ? How to do that plz answer

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

      I would suggest creating a loot anchor on your player, then a loot prefab similar to the pickup from earlier in this series, and then just instantiate loot on loot anchor and unlink from player before destroying the player

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

    Please tell me about the CCU that is the concurrent users of the Photon Pun 2. Is it for the whole game or for just a room .... Its confusing😫 😵🤯

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

    I didn't get any log showing me my player died, any idea?

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

      public void OnEnable()
      {
      PhotonNetwork.AddCallbackTarget(this);
      }
      public void OnDisable()
      {
      PhotonNetwork.RemoveCallbackTarget(this);
      }

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

    cann you make sild

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

    Yippie!

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

    "Set up" is the verb. "Setup" is a noun.

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

    Why not make a function on your object called "Package"? That way you have the logic where it's most logical, and you can call it from multiple places if need be without having to copy your code.

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

      Same goes for unpacking; you could also have a more structured and less error prone way of doing things, like:
      if (data[0] is string userName) then you have your type check + cast to the proper type. When the if fails, you know you have messed up your communication and can raise the appropriate error.

    • @welton.king.v
      @welton.king.v  5 лет назад

      @@nkusters I do this in my own projects - too much to explain in one video - it's just to show the idea to others - acute programmers can use the concepts in their own style of course