How to Make a VR Multiplayer Game - PART 3
Вставка
- Опубліковано 3 жов 2024
- Hi guys, in this video I'll show you how to make a Lobby System for our Multiplayer VR game with Photon and Unity. Hope you will enjoy this video! :)
▶ Get access to the source code: / valemvr
▶ Join the Discord channel: / discord
Hi guys here is a little bonus for you. Below you will find a script that will let you leave the room to go back to the lobby by the press of the menu button on the left controller. Simply add this script somewhere in the Scene Type 1 and Scene Type 2 and you're good to go. Also when going back to the lobby an error can appear with the voice network you can remove this error by going in the "Photon Voice Network" component and unchecking "dont destroy on load". Hope you enjoy this video :)
using UnityEngine.XR;
using Photon.Pun;
public class LeaveRoomOnInput : MonoBehaviourPunCallbacks
{
public InputHelpers.Button inputHelpers = InputHelpers.Button.MenuButton;
public XRNode controller = XRNode.LeftHand;
void Update()
{
InputHelpers.IsPressed(InputDevices.GetDeviceAtXRNode(controller), inputHelpers, out bool isPressed);
if (isPressed)
{
PhotonNetwork.Disconnect();
PhotonNetwork.LoadLevel(0);
}
}
}
Remember to make sure whatever you name the script you change LeaveRoomOnInput (near the top) to whatever you name the script!
Great Tutorial but I have a problem. I have just used this code to go back to the lobby, however when I use it to go back to the lobby and change into a different room, it gives me this error.
[NetworkVoice.PhotonVoiceNetwork] 2021-01-06T01:00:02:An instance of PhotonVoiceNetwork is already set. Destroying extra instance.
UnityEngine.Debug:LogErrorFormat(Object, String, Object[])
Very Nice.! :D :P
Need to add the "using UnityEngine.XR.Interaction.Toolkit;" for the InputHelpers
So basically this guys is becoming brackeys but then VR version of it! I like this!
I'm waiting for my pony tail to grow. :D
Joke aside, Brackeys taught me so much and inspired me to make this channel. I owe him so much.
OMG this is the best VR tutorial on internet
Hi Valem,
Your tutorials are geat !
I am just wondering ... are you planning a follow up for this MultiPlayer game tutorial, where you explain how you can add movement (walking around with the thumbsticks or teleporting) in MultiPlayer?
If you have problem with hand tracking in lobby: you have to add Input Action Manager to XR Origin and then add XRI Default Input Actions to Action Assets
I have a problem, I can’t find the “friends” anywhere
i need your help. I can not push the Button. It's like it doesn't exist. But i wrote every Script and did everything like you.
Great tutorial Valem! Keep it going. One ask: can you include how to use the Oculus Avatars in addition to custom models? Just feel the way Facebook is going they’ll use that as a measure. Sucks. Thanks mate.
nice tuts valem, apreciate so much what are you doing!
Awesome hope more VR MP tutorials will follow
is it wierd that i was waving to you when i saw your face mate? xD
Can you make a video on a wrist menu that pops up when you click something on your wrist like a watch button?
Can you make a tuturoial on how to create a newcustom generated room name? So that a friend can enter the same roomname and automaticaly join? Thank you for awesome tutorials as always! peace
Can you plz make name tags over the heads tutorial!!! I also got a question: can you move in this game or should i make that myself???
Just wondering if the next part will contain movement such as locomotion and teleportation as i tried to used the movement from your other tutorials and did not get anything working :P
also its been a while so will there even be a next part ?
Valem make vr game part 4
You should do one with mirror in unity
So awesome... You are the next brackeys ❤️.... Can we create a lobby too ?? And i have a request, i wonder if you can make this series a full multiplayer game like create lobby, invite friends, and join multiplayer game together...
That would be awesome
Question I've been searching the internet but I cannot find a way to also use 2d (Desktop) players so you don't need a VR headset to play!!
Lots of love from a bunch of XR 6th semesters :D
Is there any way to have the client xr rig communicate with that specific players Server Network player? I want to add an effect to the xr rig when the Network player collides with a certain object, but I dont know how to go about it.
Thank you so much! Also, can you maybe make a tutorial on how to make this work with Steam friends and stuff like that?
You would need it to be uploaded to steam and now since they don’t do steam community acceptions anymore you have to pay $100 to have your project uploaded
how could i make continuis movement but for multiplayer?
hello. I am creating a game in which there are 3 types of mode and in each game mode I want there to be a lobby where rooms are created. What approach do you recommend to do that? You can create 3 lobbies
i have a question,
if u change something in the scene like materials and Set.Active stuff does the other player see the changes or do u need a script to do so?
Oh my god, you must be related to Benedict Cumberbatch...!
I agree how he looks like him so much xD
I've been following your tutorials, but when i add movement to this VR tutorial (the continious movement script) it moves super fast!! Not sure why it happens, i can't edit the speed.. because if i change the value nothing happens i keep on running fast wich makes the game impossible to play (the teleport works perfectly, it's just the walking)
Other then that, awesome tutorials man!! keep them coming love it!
PS this fast walking ONLY happens when connected trough a network.. if i don't connect, i walk at normal speed like in the tutorial.. but when connected to a multiplayer room i run like crazy! hope you know a fix :D (might be dang easy,, but yeah i can't find out)
@@MickeyGMusic I know im a month late but did you add any collisions to the xr rig? If so your Network player was probably colliding with the xr rig, just change their collisions in the physics tab in the project settings
@@AlphM didn't work for me? Any other way to fix this?
Awesome multiplayer series, part 4 is even better. Quick question, is photon 20 players total or 20 players per room that you create?
total
18:06 , just saving this because I need to return to this point later
amazing
how would i make it to where it generates a code and the user can click join public and it would be a public lobby that other people are in
Great work!!!! PLS moooooore! ;-)
Hey how do I make it to where when I load up the game and connect then I join a random lobby with at least 1 other person or create a new one not just 3 rooms
can u make more videos on this subject like character models?
@Valem the voice isnt loud enough any help please!!! (btw im a new person to unity)
Great to finally see the face behind the voice of wisdom! Keep up the good work, mon brave. You are very kind to spend so much time being the guiding light that sees us safely through the valley of dev darkness! Multiplayer embodies everything that is truly great about VR gaming so well done you for focusing on this important topic...
camera = yes
.
.
.
.
.
.
.
.
.
.
got ya
you forgot to set the near clip plane of the new camera to 0.01
Hi Valem !
Nice Tuto, thank you very much !
but I have a problem with your lobby system : all players of the same room are not master !!!
It seemes that once room created, it never delete.
EDIT : I found my problem the PhotonNetwork.LoadLevel change scene before Networkmanager has finished to works
ur actually saving my life.
HOw do I make characters visible with animations with photon and VR?
any tips on how I can reduce lag on the pickups. (I am doing my setup in photon ue4)
how can I do if i want invite someone in it?
Wow :D a Wild Valem appeared. :D Didn't expect this one, :P I like your French accent :P Tnx for the Multiplayer tutorial :) I will need it during my internship :] Epic!!
Hi !, Just wonder... How can we set up the client height after / before connecting to the server ?
We can't set the Network Player Head position because it continuously getting updated...
Can you Pleas make a Tutorial How to Shot and kill in Multiplayer thanks.
My way works but I’m sure if Valem did a video on it I’m sure he could make a better way!
If you are getting an error when selecting the room to enter (scene not in the build settings -add it) then here is my fix. In the "InitializeRoom" method (in the NetworkManager) I injected the defaultRoomIndex right into the PhotonNetwork.LoadLevel(defaultRoomIndex). Just ensure that you have the proper index for the scene in your room button canvas.
the best
I tried adding your continuous movement script from your previous series but when I joined through the lobby it made me teleport backwards when I moved the joystick. How do I fix it?
actually dont worry i found a fix further down in the comments
@@ecykal35 how to fix that :'' I already tried but didn't work
Please help, I have one quest 2 headset. Is it possible to make a multiplayer game with it? How would I test it?
Where is part 4?
Does this multiplayer series work on Quest? Without link?
Can you make a tutorial for making a full body?
He has a three part video series starting here, ua-cam.com/video/tBYl-aSxUe0/v-deo.html. I have gone though it and it should help you out.
could you teach how to make roblox vr games? i've been trying to make a vr game on roblox for 6 months could you help? if you cant is fine
Valem, is there a way to make an objects collision work when you have grabbed it? like how do you make a sword grabbed by the played, collide with an object? i cant get the sword to collide unless i drop the sword. do you know this problem?
How can you synchronise material change over network
It’s been awhile since I’ve watched but I recently got back into my quest and wanted to check to see if you were still uploading. So glad to see you still are! Please keep going strong as I’m gonna binge what I missed in quarantine bro!
hi, great tutorials, I still want to know how to set the spawn position for each player? They now all spawn at the same spot (0.0.0)
make a part 4 where you customize your character in multiplayer
I have a Question, how do you make a name system
strange he looks exactly like I thought he would
You are the only person I've subscribed to Patreon for. Ever. That should tell you how valuable your tutorials and help is. Keep up the great work!
Oh thank you so much for the support Tayo it means a lot ❤️
It would be really cool if you could show how to make the Gravity Gloves from HL:A :D
Is your vr tutorial for the basics is done
Are anyone else's VR Rigs from the VR basics with the continuous movement script suddenly moving way faster than they would prior to adding photon? This only seems to happen when I use the Lobby button to load the next scene aka room 1, room 2, etc...
This seems to be a problem with the CapsuleFollowHeadset() method. If you remove that, does it work for you?
@@Rixium ahh sorry I did fix it. I made a new layer for the network player and made it ignore my playerbodylayer since they were colliding and bouncing around as far as I could tell.
@@coreyduncan3427 Thanks for that! I was having trouble fixing it. I just ended up moving the charactercontroller and the player controller to the Camera Offset, and it also worked too.
@@coreyduncan3427 Hi! omg you save me I have the same issue! Can I have a little more information on how you manage to ignore a layer? Thanks!
Thank you so much
Fantastic theme. Multiplayer has so much potential in VR.
pls donated me REBEX
great part 3! thx Valem for awesome video!
Bro you are amazing! Keep up the work
Movement next please
HOW
HOW
🙃
You are gonna be huge. Keep up the good work! :)
If anyone is watching recently can you help me with the UI it wont work
What you need to do is, instead of: "roomUI.SetActive(true);" make it: "roomUI.SetActiveRecursively(true);"
s
omething
Love the upgrade of the camera! Nice to see you again. Keep up the good work!
Hi Cai, happy to see you here thank you for the comment !
Hi,
I have a question - I would really like to have a nickname system in my game. Would you like to make a tutorial about that?
did you find one?
@@skrecek5 sadly no
Jes
Second
Thank you for your great help~
THIRD
Actually I’m third
Hii awesone :) Are you single ?
Yes