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.
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
Thanks for the kind words. I really appreciate it! Glad it helped. 8)
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
Thanks, I am glad it helped you!
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)
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.
Excellent video. It solved my problem perfectly. Thanks!
Thanks, Glad it helped!
Subscribed for this. Ive been looking for hours. May your travels lead you to warm sands friend.
Thanks! Glad I could help! 8)
Thanks for the tutorial you did.
You are welcome. Thanks for watching I hope it helped. 8)
@@corkiesoftwaredesign1558 it really helps me Sir.
bro, thanks it helped!
You are welcome. Glad it helped you! 😁
aaaah yes the solution i needed
Thank you very much!
You are very welcome! Glad I could help. 8)
Life saver
Thanks, glad it helped.
thank you
You're welcome, hope it helps! 8)
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.
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)
I’m using fusion but when I use cinemachine on networked objects the camera seems to lag a bit
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
Muchas Gracias. 👍
You are welcome. Hope it helped. 8)
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.
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! 🙂
What if you aren't using Cinemachine
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.
Still go the same problem
Can you do this without mirror?
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)
i dont use cinemachine :C