Game Dev Gives Away Hats (Over the Network) - Unity Photon Fusion Tutorial

Поділитися
Вставка
  • Опубліковано 27 лис 2024

КОМЕНТАРІ • 17

  • @azzo182
    @azzo182 Рік тому

    Thanks a lot man, your tutorials are awesome! im working on a game for my kids and this was just what i was looking for, now i have to learn how to make the changes permanent so each player keeps the hat they put on in here haha, thanks again!

    • @PhilipHerlitz
      @PhilipHerlitz  Рік тому

      You could save that hat choice to playerPrefs. Or, if you're handy with backend stuff, you could save in cloud in firebase. If you've never used firebase, something easier is gamefuse.co/ or www.lootlocker.io

  • @Forkbomba
    @Forkbomba Рік тому +1

    Thank you so much for this series and the previous ones as well. I am confused regarding the instantiation choice here. Did you choose to have GameObject instantiation over the network one because our player is already network instantiated? Or is it something else? Also for your current approach, the hat will surely disappear when you enter another room. How else would you design it to be persistent?

    • @PhilipHerlitz
      @PhilipHerlitz  Рік тому

      I don't spawn it over the network, because each player is checking for the hat value to change. They can create them locally. If my players are going to be moving from scene to scene, i'm going to put 'Don't Destroy on Load' on the root. Since the hat is a child of that root, it will 'stick around'. Spawning takes more time than syncing a variable. So, by syncing the variable and having everyone create the object locally, it happens faster.

  • @RSureshKumar-o1p
    @RSureshKumar-o1p 3 місяці тому

    When I entered Onchanged attribute it's throwing error.

  • @onLin_studio
    @onLin_studio 4 місяці тому +1

    Hello. I need your help. How to control doors in Photon Fusion 1. Thanks in advance for your reply

    • @PhilipHerlitz
      @PhilipHerlitz  4 місяці тому

      Thats not a lot of information to go on. But my guess is you're wanting them to be open or closed, and sync'd over the network. I only have experience with Fusion Shared. So if you're using Fusion Shared, the doors are all owed by the Master client. You can sync their state using a networked bool. Or, you might not need to sync at all if you just open and close it based on triggers.

    • @onLin_studio
      @onLin_studio 4 місяці тому

      Yes
      For example, I wanted to make it so that when one player comes and opens the door, the other player comes and closes the door. What method do you recommend for this?

    • @PhilipHerlitz
      @PhilipHerlitz  4 місяці тому

      @@onLin_studio Player who opens the door, sends RPC to the door script to open door. Player who closes the door sends RPC to script to close the door. Those RPCs should probably also set an 'isOpen' bool to true/false and sync that ever the network.

    • @onLin_studio
      @onLin_studio 4 місяці тому

      @@PhilipHerlitzThank you very much. Now I can open and close the doors. I did it via RPC

  • @_ciraz_
    @_ciraz_ Рік тому

    Hello, I have a question or a tutorial suggestion. How can I use a slider to share the health of my character over the network, so the health also subtracts when the character gets damaged? I am talking about a basic health system with the use of Photon Fusion. I tried to add it on my own but the „Value“ and the „Max Value“ of the UI Slider, that i use to display the health amount above the character, does not seem to get synchronized right. Maybe you can help with a tutorial regarding that issue? Thank you very much for all your tutorials, they’re fantastic!

    • @PhilipHerlitz
      @PhilipHerlitz  Рік тому +1

      LOL. Did you just happen to ask this in the Fusion.Shared discord? If you did, I just answerd you over there.

  • @rezadermawan4562
    @rezadermawan4562 Рік тому

    hello master I'm really waiting for your photon fusion multiplayer tutorial, when a player takes a sword or opens a box with an animator it can be seen by all players, is that possible?players can interact with objects or something.

    • @PhilipHerlitz
      @PhilipHerlitz  Рік тому

      If you just want to use player proximity to open the box, you don't need to do any networking. It will just happen for everyone locally when a player is in proximity.
      But, if you need something a bit more interactive, the box would need to be a network object. When interacted with by a player, an RPC would need to be sent to all the other players, to let them know this player is interacting with it.

    • @rezadermawan4562
      @rezadermawan4562 Рік тому

      @@PhilipHerlitz Can you give an example, Master? in the form of a simple tutorial in the form of interacting with objects or anything with photon fusion. I really want to know, master, how this process can be seen by all players with a network object, just the object is released and held by the player, does it require a network transform when the player carries the sword?
      with "trigger collider" and also tag "Pickable"?, thank you master.