Tutorial: Online multiplayer 🔫 FPS Unity & Photon Fusion EP12 (bots & pathfinding with navmesh) 🤖

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

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

  • @PrettyFlyGames
    @PrettyFlyGames  Год назад +3

    Missed a tiny thing in the AIHandler.cs code
    Add:
    distanceToTarget = 0;
    //Check that we have a target
    if (target == null)
    SetTarget();
    if(targetHPHandler.isDead)
    SetTarget();
    In the GetDirectionToTarget function. It wasn't using the targetHPHandler at all which it should, otherwise it will keep shooting at dead players.

    • @4vior
      @4vior Год назад

      can you show us how the lobby owner can kick other players in the lobby (when the screen is ready) + how to exit the lobby while the player is already playing in the lobby( in the map)? (By KOPAMAN)

  • @KOPAMANNN
    @KOPAMANNN Год назад +7

    can you show us how the lobby owner can kick other players in the lobby (when the screen is ready) + how to exit the lobby while the player is already playing in the lobby( in the map)?

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

      yes pls

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

      we are following your tutorial with @KOPAMANNN , and we really need to know that. Pls could you show us how to do that? (you ROCK! :) )

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

      it might actually be useful and like even the user list can be good in game, and the owner of the lobby can kick people who joined the lobby in the "World1" scene for exemple

    • @4vior
      @4vior Год назад

      it can be really good, @PrettyFlyGames

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

      good idea!

  • @animalfun7794
    @animalfun7794 Год назад +2

    nice!

  • @ashtydev
    @ashtydev Месяц назад

    please continue this

    • @PrettyFlyGames
      @PrettyFlyGames  24 дня назад

      In the near future no more episodes are planned for this. What would you like to see in the future?

  • @H_Battousai
    @H_Battousai 10 месяцев назад

    Great tutorial!! One thing that got me thinking is since the host user has to manage the bots, would this cause a performance disadvantage for them?

    • @PrettyFlyGames
      @PrettyFlyGames  10 месяцев назад

      I don't think that it will use that much performance unless you have loads of them. The host has a lot of other advantages so this would even the playfield a bit (just kidding because if the host is overburden then all other clients will get a very bad experience).
      You can do a lot of optimization to get it to run even better but I don't think it is needed yet.

  • @sebastianecheverry4458
    @sebastianecheverry4458 5 месяцев назад

    Hi question. Is it possible to add collision matrix to not hit your team mates?

    • @PrettyFlyGames
      @PrettyFlyGames  5 месяцев назад

      Hi!
      You can add the layers which should be used for the raycast, so either you use your teams for that or you can have some other way of detecting if there is a teammate, like using tags or attach a team script to it.

  • @Foz_Games
    @Foz_Games 10 месяцев назад

    Adds a chat for players to communicate

  • @pags6480
    @pags6480 4 месяца назад

    As of now I am using photon pun 2 for my RPG and its working as expected however the pain in the ass here is the enemy bots if the master client disconnects all of them will stop functioning even if the masterclient is in the background still the bots stop working also. Im also thinking of transferring to fusion. Do I still encounter it? I just wanted a Not Host Dependent Enemy AI that also syncs

    • @PrettyFlyGames
      @PrettyFlyGames  3 месяца назад

      In Photon Fusion the new host can take over the handling of the AI if the old host disconnects.

  • @gamedevpk
    @gamedevpk 4 месяца назад

    Amazing but problem is when host player leave the game then Bots will also remove because after leaving the game all the host data will be destroyed

    • @PrettyFlyGames
      @PrettyFlyGames  3 месяца назад

      Thanks 🙏
      Nothing gets automatically destroyed by Photon Fusion however the code does destroy the bots when host migration is triggered. You can adjust the code so that bots are not destroyed when host migration happens.

  • @anirbanparam1087
    @anirbanparam1087 11 месяцев назад

    Thanks for the tutorial ! It was really good and I want to ask that how can I sync animation rig like using aim constraints in network?

    • @PrettyFlyGames
      @PrettyFlyGames  11 месяцев назад

      Glad that you liked it. Most of the time in networking you can cheat which most games do. So do you really need it to be synced or is it enough to provide the data and then let each client handle it on its own. Unless you have 2 pc next to each other looking at the same object the players won't notice really.

    • @anirbanparam1087
      @anirbanparam1087 11 месяцев назад

      @@PrettyFlyGames Thanks for response!.I want to sync it because I tried by providing data to each client and let them handle it It jitter most of the times but It not that much big deal and I want to ask if its a bug or not but I have many objects in my scene and the playes are laggging too much on the network but I disable render shadow in camera for objects in my scene it does not lagg anymore How can I fix it?

    • @PrettyFlyGames
      @PrettyFlyGames  11 месяцев назад

      ​@@anirbanparam1087 If you have lag with shadows on and it works good with shadows off then it means you have a frame rate issue which is not related to the networking. I would advise that you add a FPS counter and then use the profiler + frame debugger to figure out what is taking the performance. If you are on webGL or lower end mobile platforms then you'll have issues with shadows on many objects so that will be tricky but you can tune the shadow distance and maybe everything doesn't need real time shadows.

    • @anirbanparam1087
      @anirbanparam1087 11 месяцев назад

      @@PrettyFlyGames Well the game is not lagging but the other character movement on network are lagging(not my character from my pov) on the network only if the shadows are on.(There is no frame rate issue).

    • @PrettyFlyGames
      @PrettyFlyGames  11 месяцев назад

      @@anirbanparam1087 that does sound very strange as shadows have nothing to do with the networking really. The networking will only sync the positions of the game objects and it doesn't care if shadows are enabled or not. If this also happens when you are the host then it is not related to networking as the when playing from the host it is just like playing a regular single player game.

  • @AdieVentureVlog
    @AdieVentureVlog 10 месяцев назад

    can you show us on how to convert it to mobile platform sir thank you

    • @PrettyFlyGames
      @PrettyFlyGames  10 месяцев назад

      There are lots of videos showing how to add touch input to Unity. Then you simply wire that to the input instead of reading the keys + mouse.

  • @GrayFoxware
    @GrayFoxware 11 месяцев назад

    photon fusion 2.0 tutorial update?

    • @PrettyFlyGames
      @PrettyFlyGames  11 месяцев назад

      Once it is fully released. Now it is on RC status.

    • @GrayFoxware
      @GrayFoxware 10 месяцев назад

      @@PrettyFlyGames Ok great thanks.

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

    i would love to see how the owner of the lobby can kick the player and i agree with @KOPAMANNN, i guess we need to leave the lobby during the ready scene and during the "world1" scene

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

      You can kick a player from the host/server by calling Runner.Disconnect(PlayerRef); You can see how that is implemented in ReadyUIHandler.cs where the host will kick any unready player.
      To disconnect as a client you would call Runner.Shutdown() or networkRunner.Shutdown() if you don't call it from a script deriving from : NetworkBehaviour