Unity3D Tutorial Mirror Networking Camera Follow Local Player

Поділитися
Вставка
  • Опубліковано 28 сер 2024
  • How to fix a problem I found, and apparently some others, when trying to get the camera to follow the correct player in Unity3D using Mirror networking in a multiplayer game. Not really a problem with Unity or Mirror, just the correct code you need to use to get this to work correctly. Hope it helps others.

КОМЕНТАРІ • 36

  • @fzee4857
    @fzee4857 2 роки тому +6

    After watching tons of videos, yours was the best and to the point, it took me few minutes to take care of this simple issue. thanks

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

    thanks so much , was trying to figure out this exact part. didn't find any videos regarding this. i made multiple cameras which constantly kept switching was annoying . the is local code fixed everything

  • @brootalpixelgames9559
    @brootalpixelgames9559 3 роки тому

    thank you for the quick video! I watched longer videos that didn't do the trick, also for anyone having issues, try using his method but with a normal camera (if that's what you're going for)

    • @elliottk68va
      @elliottk68va 3 роки тому

      Thanks! I used the freelook orbit cam because I am making a space ship game and it worked pretty good for that. But thank you, and glad it help! - Corkie Software Design.

  • @oldmanjim4853
    @oldmanjim4853 2 роки тому +1

    Excellent video. It solved my problem perfectly. Thanks!

  • @mickaell8714
    @mickaell8714 2 роки тому

    Subscribed for this. Ive been looking for hours. May your travels lead you to warm sands friend.

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

    Thanks for the tutorial you did.

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

      You are welcome. Thanks for watching I hope it helped. 8)

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

      @@corkiesoftwaredesign1558 it really helps me Sir.

  • @goldencat567
    @goldencat567 11 місяців тому +1

    bro, thanks it helped!

  • @paulorodriguez6288
    @paulorodriguez6288 3 роки тому +2

    aaaah yes the solution i needed

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

    Thank you very much!

  • @la_treta
    @la_treta 3 роки тому +2

    Life saver

  • @darkslash21_
    @darkslash21_ 2 роки тому +1

    thank you

  • @bakguff
    @bakguff 3 роки тому

    Nice video! I've been having trouble with this issue. However, with your implementation do you think it would have trouble when adding multiple FreeLookCameras in the game? I would imagine so since the method is looking for any and all freelookcameras especially if the other flc is going to be used for another purpose and has special scripting for that.

    • @elliottk68va
      @elliottk68va 3 роки тому

      I would have to play around some to find out for sure, but I think you could just give the free look cameras different names in the hierarchy. Then in the start function just have the game "find" that particular game object/camera. As long as you were assigning it to a Cinemachinesfreelook variable it would work I would think. That's where I would start anyway. Hope that makes sense? If I get a chance I might test it out for myself. Thanks for the "nice video!" comment. I appreciate it! 8)

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

    I’m using fusion but when I use cinemachine on networked objects the camera seems to lag a bit

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

      Hi, I remember encountering this problem also. I think I finally just deleted the library and let Unity rebuild the project and it went away. It's been 2 years since I made this video so I can't remember the exact solution. We had a large thread on it at the forum though as others had the problem as well. Here it is, I hope it helps: forum.unity.com/threads/semi-solved-cinemachine-freelook-has-bad-jitter-at-high-speed-reinstall-cinemachine-can-help.1034971/page-2#post-9371921

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

    Muchas Gracias. 👍

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

    I think with the latest updates it stopped working again. At least it doesn't work for me even though I did everything the same way.

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

      Thanks for watching and sorry it didn't fix your problem. I have been doing more on the game design document on my game, trying to lay it all out. Hopefully I will be back to programming soon. Its been 2 years since I made this and I am looking at a newer system out that is also free call FISHNET. It's on the unity asset store and is very similar to Mirror. If I get the opportunity I will try to make an update to this video if I see things are not working the same. Thanks for letting me know! 🙂

  • @acez28
    @acez28 2 роки тому

    What if you aren't using Cinemachine

    • @corkiesoftwaredesign1558
      @corkiesoftwaredesign1558  2 роки тому +1

      I haven't did it that way, but I would assume just where you are assigning "freeLookCameraToZoom" you would just make it "mainCameraToZoom" or something of that nature. You just have to assign the camera you want to zoom. Whether it's a Cinemachine or not I do not think would matter. Of course you will also need to make sure that camera is looking at your player object. Maybe "transform.LookAt(target)" would help you there.

    • @acez28
      @acez28 2 роки тому

      Still go the same problem

  • @ict-13delacruzschxydelowke69

    Can you do this without mirror?

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

      How do you mean? With another networking package? I have to be honest and say I do not know. Since working on this video 2 years ago I think I have decided to go with Fishnet networking instead. I may look into Unity's new networking system also. But I imagine it would be something similar with any networking solution you decide to use. Fishnet can be found on the Unity Asset Store. It is a lot like Mirror but seems to be more robust, modular and preformat. I am still working on this same game. So we will see in the future what I finally come up with. 8)

  • @justinsijbolts
    @justinsijbolts 2 роки тому

    i dont use cinemachine :C