Play Online Together Using Relay || Unity Tutorial

Поділитися
Вставка
  • Опубліковано 29 січ 2025

КОМЕНТАРІ • 37

  • @MegaGangsta4life
    @MegaGangsta4life 9 місяців тому +3

    Bro your channel offers so much value, please keep it going

  • @kepper104
    @kepper104 26 днів тому

    Omg this was so easy this whole time?! Thank you so much, if only we had this video we would have had a working game on the gamejam that was two years ago lmao

    • @freedomcoding
      @freedomcoding  25 днів тому

      I am glad it helped! You can use it next time :)

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

    Yo this tutorials are very awesome and you are explaining the things too. Please keep it. I loved your videos

  • @trialgamingftw9988
    @trialgamingftw9988 10 місяців тому

    Helps me greatly for my game dev class! subbed and waiting for more to this series!!

  • @PineappleBrain
    @PineappleBrain 3 місяці тому

    The tutorial is easy to follow and the explain is very clear
    Thankyou 😆

  • @yungsidsteamboattt5534
    @yungsidsteamboattt5534 2 місяці тому

    I have the problem that if I have more than 2 players, the position of the 3 player is no longer visible in the other clients. Only the host sees everything “correctly”. Unfortunately I cannot understand the problem. Does anyone have a tip for me as to what it could be?

    • @freedomcoding
      @freedomcoding  2 місяці тому

      How are you spawning the players? Have you assigned the player prefab in the NetworkManager?

  • @dmitrywroclaw9165
    @dmitrywroclaw9165 5 місяців тому

    Great example! Thank you!

    • @freedomcoding
      @freedomcoding  5 місяців тому

      I am glad you liked it! You are welcome.

  • @PawanRamnani-r9b
    @PawanRamnani-r9b 8 місяців тому

    One small query :
    After lobby, i have to move to the Level Selection scene which selects which level to choose.
    That level scene is an addressable which is being downloaded from cloud.
    But net code does not seem to work with addressable scene.
    Any advice?
    I am thinking two options :
    1)
    Use RPC to manually load the addressable scene on all clients
    2)
    Make all the contents of the scene an addressable prefab and then include the empty scene in build settings which can be loaded through netcode. Then instantiate the adressable when the scene is loaded by netcode.
    Thanks in advance 😃

    • @freedomcoding
      @freedomcoding  8 місяців тому

      Hi, I havent used Addressables with Netcode yet, so I am not sure. I would go with the second approach. Let me know how you solve it!

    • @PawanRamnani-r9b
      @PawanRamnani-r9b 8 місяців тому

      @@freedomcoding Already started with 2nd approach and it worked.
      Thanks for the reply though.

  • @Khio890
    @Khio890 7 місяців тому

    Hi, i was wondering how i could manually set region when hosting, from the unity docs i found out that you can add a region by adding a string to the 'CreateAllocationAsync' the only problem is i don't know what to put in the region string could you please help me out.

    • @freedomcoding
      @freedomcoding  7 місяців тому

      Hi, you can simply pass it as the second parameter of that function - CreateAllocationAsync(4, "MyRegion"). I guess you want to setup some dropdown to select the region, then you can add a reference to the dropdown and pass the text value from it as the second parameter.

    • @Khio890
      @Khio890 7 місяців тому

      @@freedomcoding Thanks, is there a list of available regions?

    • @freedomcoding
      @freedomcoding  7 місяців тому

      @@Khio890 Yes - docs.unity.com/ugs/manual/relay/manual/locations-and-regions

  • @JanDevPL
    @JanDevPL 10 місяців тому +1

    Good video!!!

  • @mckatowice7163
    @mckatowice7163 9 місяців тому

    How to make a savesystem to multiplayer game in unity? Please Response.

    • @freedomcoding
      @freedomcoding  9 місяців тому

      Hi, you can use Unity's tool Cloud Save. I haven't worked with it yet, but soon I will probably get to it.

  • @kickr-i7d
    @kickr-i7d 10 місяців тому

    how to transfer host when host leave the game please help me

    • @freedomcoding
      @freedomcoding  10 місяців тому +1

      This is one of the tricky parts of peer-to-peer connection but it is surely possible to solve that. I haven't tried it myself. Check this - docs.unity.com/ugs/manual/relay/manual/host-migration. Or you can use dedicated servers (Multiplay) about which I made tutorial a few days ago.

    • @kickr-i7d
      @kickr-i7d 10 місяців тому

      @@freedomcoding can u make video on it please i need it

    • @freedomcoding
      @freedomcoding  10 місяців тому

      @@kickr-i7d I am putting it on my list. There is still a lot of stuff to cover about Multiplayer in Unity, so maybe some time.

    • @kickr-i7d
      @kickr-i7d 10 місяців тому

      @@freedomcoding please asap do i need it very much

  • @robbykane9614
    @robbykane9614 9 місяців тому

    Hi! I've followed your Series for my Thesis Project and I cannot Say THANK YOU SO MUCH! I've gotten Half my work done originally in amount of short time thanks to you!
    I do have one question though...Is it possible when after Pressing Host Game, or Join Relay, Can you Host it instead to another Scene? If there is an easy code how, I would really appreciate it! Once again Thank you for your Series and I'm Pushing hard before my deadline! ^_^

    • @freedomcoding
      @freedomcoding  9 місяців тому

      Hi, I am glad I could have helped you! Yes that should be simple. I would set the player object with the network manager and relay manager as DontDestroyOnLoad, so you can then transfer them to the other scene (DontDestroyOnLoad(gameobject)). For loading of the scene just add using UnityEngine.SceneManagement and then you can do SceneManager.LoadScene. I hope this helps. Good luck with your project!

  • @SayanshXD
    @SayanshXD 10 місяців тому

    is there any code for Relay Manager i can copy and paste? I am having errors.
    great video btw.

    • @freedomcoding
      @freedomcoding  10 місяців тому +1

      Hi, here is the code - docs.google.com/document/d/1-L7oYA81WvBn4ZHlzXGgOVkd_3k2wjUK5IWE9dwktCk/edit?usp=sharing. I am glad you liked it!

  • @Lukasspl27
    @Lukasspl27 8 місяців тому

    relay is free?

    • @freedomcoding
      @freedomcoding  8 місяців тому

      Yes up to 50 concurrent users. You can find more info about the pricing here - unity.com/solutions/gaming-services/pricing.