Modify the "OnStartAuthority" method to the following public override void OnNetworkSpawn() { // This is basically a Start method cameraHolder.SetActive(IsOwner); base.OnNetworkSpawn(); // Not sure if this is needed though, but good to have it. }
if i have 2 player, camera in scene have 3 (main, cam_player1, cam_player2) it make view of each player can't move anymore. What should i do, if just 1 player it run perfectly
Nice tutorial :) I'm still wondering how to make the camera's rotation work, so like make the player move in the direction the camera is facing at (transform.right?).
Because the position isn't exactly the parent position there is an offset that gets added so we need to update it. Also if your wanting the camera to lerp you'd need to do this
@@ZygerGFX that's logical, so you could also just assign the offset to the local position of the cameraholder. but does the cameracontroller have to be on the playerobject? It seems counter intuitive to have all the components on the same object
@@halo123proplem No it doesn't have to. in fact in my own little project it isn't. I made it on the same object here for simplicity's sake. If I had it not be parented then there would be a little more work to do, and since a lot of beginner people follow these tutorials I opted to not go that route. By all means if you are seriously trying to make a game that you're planning on releasing then I would recommend using a different system since I agree with what you said of it being counter intuitive, but most people don't which is why I did it that way in this tutorial.
@@ZygerGFX Thank you for the clarification and thank you for these tutorials. I would love to see a network tutorial for how the players interact with objects in the scene, f.x picking up a box or kicking a box. do you have anything like that planned?
@@halo123proplem I haven't got anything planned like that though its a good idea. I will probably at some point do something similar though don't know how long it will be till then.
one of the best tutorials around. would be nice if you made one with unity netcode
Modify the "OnStartAuthority" method to the following
public override void OnNetworkSpawn() { // This is basically a Start method
cameraHolder.SetActive(IsOwner);
base.OnNetworkSpawn(); // Not sure if this is needed though, but good to have it.
}
I have been having this problem for days! thank you so much!@@karmaa1036
if i have 2 player, camera in scene have 3 (main, cam_player1, cam_player2) it make view of each player can't move anymore. What should i do, if just 1 player it run perfectly
thanksss, i ve been having this issue for a long time and couldnt find solution anywhere. I adjusted your way for photon network and it worked.
thx for the tutorial. congrats for your new job :)
Great tutorial, thank you :)
Nice tutorial keep it up!
it works but when another person joins the game my camera rotation doesn't turn with the player anymore..and when he leaves it starts working again
Nice tutorial, but you forgot to add this and the next tutorial to your steam multiplayer playlist :)
thanks, you made it very simple 😃
Cool😊
Nice tutorial :)
I'm still wondering how to make the camera's rotation work, so like make the player move in the direction the camera is facing at (transform.right?).
thanks!!
Nice job
Finally
Everything works except that the client cant see the host player. The host player can however see the client player
Is there a reason you assign the position every frame even though the camera is a child object of the player?
Because the position isn't exactly the parent position there is an offset that gets added so we need to update it. Also if your wanting the camera to lerp you'd need to do this
@@ZygerGFX that's logical, so you could also just assign the offset to the local position of the cameraholder.
but does the cameracontroller have to be on the playerobject? It seems counter intuitive to have all the components on the same object
@@halo123proplem No it doesn't have to. in fact in my own little project it isn't. I made it on the same object here for simplicity's sake. If I had it not be parented then there would be a little more work to do, and since a lot of beginner people follow these tutorials I opted to not go that route. By all means if you are seriously trying to make a game that you're planning on releasing then I would recommend using a different system since I agree with what you said of it being counter intuitive, but most people don't which is why I did it that way in this tutorial.
@@ZygerGFX Thank you for the clarification and thank you for these tutorials. I would love to see a network tutorial for how the players interact with objects in the scene, f.x picking up a box or kicking a box.
do you have anything like that planned?
@@halo123proplem I haven't got anything planned like that though its a good idea. I will probably at some point do something similar though don't know how long it will be till then.
nice tutorial now though can you put that you can move the view? thanks
Could you explain what you mean ?
@@ZygerGFX that you can turn and move the visual
thanks babe as always
Can you do another version with cinemachine?
It's basiccaly the same, we just affect the camera holder
Does this use Untiy Network Gameobjects alongside Mirror?
no its mirror and steamworks
Or just get if not local player then deactivate camera
Yeah its the same thing just the opposite way around. But also can be used :))