#archived-networking
1 messages · Page 113 of 1
hey quick mirror question, on the pong example, why is the rigidbody simulated only for the ball but not for the players?
The host of the game should be connected with host too ?
I am working on a multiplayer game which is have very simple networking system.
The host of the game creates a server, now you can either join is a client or just be a server
if you want to host AND play then you also need to make the host a client
from my limited understanding
What is the best for a Lobby Ranked game. Unity MLAPI or Photon Pun 2? I will have a dedicated server hosted somehwere
Steam could also be an option
Is that a systeam like MLAPI or photon ?
I am looking for days for a good and easy to implement Multiplayer system. Which i can have multiple loobys and a ranking system. Phonon does that but its laggy
https://partner.steamgames.com/doc/features/multiplayer/matchmaking#:~:text=The Steam peer-to-peer,like users or game servers.
this is the documentation for matchmaking and lobbies
I heard that its a paied system right? Is there a free period where i can use just for testing ?
eh it's the opposite I believe, most other systems are paid,
https://github.com/Facepunch/Facepunch.Steamworks#why
but please do your own research and prototype because I have no experience actually implementing this. I mostly did some research into different solutions but for my usecase it was simple enough to write it myself
I watched this youtuber making a steam multiplayer game and he said that paid 100 Dolars
https://www.youtube.com/watch?v=_ze26M_Fm6g&ab_channel=Dani
haha squid game go brrrr
➤ Download Crab Game for free - https://store.steampowered.com/app/1782210/Crab_Game/
➤ Buy My PLUSHIE - https://www.makeship.com/products/dani-plush
➤ Game Music by Context Sensitive -https://www.youtube.com/watch?v=J1qR2d1kIrE&ab_channel=ContextSensitive
➤ Discord - https://discord.gg/dani
➤ Twitter - https://twitte...
Ah I see, yeah that is the fee for publishing the game on Steam, it's not specifically paying for the networking though
You also get it back if your game has 1000$ revenue
Ahhhhhhh
i though the network system was 100
So i can try that steam feature
Thanks
But if implement that, the game wotn be on steam servers right? When i publish and pay, it goes to the steam server?
What i dont understand is, Steam Network is just a system to connect to a game right? I still need to use MLAPI or Photon?
Because on the documentation i dont see any reference to spawning objects
And other things
How can i make it for my social deduction game's informed minority (the traitors) to know who eachother are? I am using Photon Unity Networking/
the way i want to do it is so that the players with bad roles will see eachother with red names while the others dont.
yeah for your initial question I was mostly seeing the "multiple lobbies and ranking system" part. Steam does not have any multiplayer application level code (not the logic) for running your game, just the infrastructure. So basically the pipes but not the toilet. Proton has both the pipes and the toilet, mirror only the toilet I believe (excuse the simili)
You can also mix the pipes and toilets, so such Steam for the infrastructure and Mirror for the multiplayer logic, however finding a good integration is challenging I believe. If you feel you are strong programmer with a good understanding of UDP and server-client architecture then for small projects I would even recommend writing it from scratch.
Photon is only free up to 20ccu, something to keep in mind.
this youtuber has some entertaining videos that can help, but note that I think in the end his implementation does not work very well https://www.youtube.com/c/TomWeiland/videos
Hi! I have been reviewing the code of the example projects and I dont understand this (from mirror)
NetworkServer.RegisterHandler<CreatePlayerMessage>(OnCreatePlayer);
this is done on the network manager when the server is started, CreatePlayerMessage is a struct that only contains a name, while, OnCreatePlayer is a void method
this is on the Chat example
For lobby or for all the lobbys?
And steam combined with MLAPI?
The only thing that i dont understand is where the server is hosted if i use MLAPI and steam
it totally depends on the game, you can have one of the players be the "host" (server) and the other players will connect to that player (Client/Host model). In that case you don't need any hosted server. If you are able to do that for your game, it simplifies things in most cases so I'd recommend it. Now if you have a case where you need a central server and the players connect to that server, yes, then again it depends on what it is that the server does, if it just passes the data from player A to player B that means you need a Relay server and Steam (and some others) can do that. Now if you need what is commonly called a dedicated server that runs a headless version of the game that server can be hosted anywhere, but that is outside of the scope of I think all of the big frameworks. The connections to that server can be done with again Proton, Steam, MLAPI, etc.
But, judging by your answers, I think you might have to first look into your game multiplayer architecture before you can decide on any frameworks. In my opinion of course.
This is a very good start
https://gafferongames.com/post/what_every_programmer_needs_to_know_about_game_networking/
Introduction Hi, I’m Glenn Fiedler and welcome to Networking for Game Programmers.
Have you ever wondered how multiplayer games work?
From the outside it seems magical: two or more players sharing a consistent experience across the network like they actually exist together in the same virtual world.
But as programmers we know the truth of what i...
if you decide to do a manual implementation ever, start here
https://www.gabrielgambetta.com/client-server-game-architecture.html
Thanks for the reply! My game idea will be a arena type game, where players fight each other. It will have a ranking system and ranking matchmaking.
So for this i think i will need a dedicated server. So i will have to do a project that will be the server and the project that will be the client i think
Games like League of legends and Apex legends, the lobbys where players are, are on a server or the game sees who have the best PC and select him as a host?
What i pretend is this:
I just need to know how to structure this. Because i make a server, and i use steamNetwork to connect to that server right?
Can i host my server on Steam?
Or i have to use another hosting website?
"The other option is to use something like the SteamP2PTransport, which will work without the need of setting up any servers if you release your game on Steam." This is on Unity MLAPI documentation, that from what i understand is saying that i can use Steam servers
But isnt steam just a conection?
I am lost xD
No, the transport allows you to use steams relay servers
You can't host dedicated servers over steam
Steam networking is strictly for client host games
So i need to find a service where i can host a dedicated server right?
And use steam to connect to it
But because of port fowarding i need steam
Ahhhh i get it. So i just need to use MLAPI
Yes any networking library would do in this case
Nice
For testing over two different machines and network, i need to host or is there a easy way to test?
you can just host server locally and join over lan with other computer if theyre on the same network
but for over the internet testing you will need to port forward or pay for vps
Can you talk more about that VPS? I place the server on a vps?
i used photon but it fells laggy
thank you 😂
I solve this problem
as a old minecraft developer decided to make it like minecraft
In Photon Pun 2, the CCU limit is for lobby or for all lobbys?
I will try first with Photon 2, if the lag is aceptable i will continue with it
@grim bramble Mirror is free and supports the server architecture you're describing, pun2 is another relay service similar to steam (but includes netcode)
that's what people use relays for.
epic relay is free btw.
Hello, i currently have issues with my system for my social deduction game where players on the Mafia team can identify eachother. My issue is that when mafia players identify eachother (they identify eachother by name color since white = not mafia and red = mafia) only happens when the MasterClient is Mafia and only for the MasterClient and not the other mafia members plz help me. (using Photon Unity networking)
The logic for that is completely custom, so it's a bit tricky to help with.
Also, I did not understand yet, what the problem is. Something only happens when the Master Client is in the Mafia? But .. what happens then?
let me explain
Also .. why is this part of the game state fit in the color of a player name??
thats how mafia members know eachother
if ur mafia u have a red name visible only to u and other members
anyways
but that's something that is just a visual effect, based on a custom player property?
in my game there is 10 players, and 2 of them are mafia and i want the mafia to know eachother via red name and the masterclient(if mafia) is the only one who knows who the others are, meanwhile if a non masterclient gets mafia, they wont know their teammate
wait wait wait i think i know the problem
Maybe the Mafia GameObjects dont get synced since i only call the function where roles are assigned so how can i sync GameObject references?
You can't. You can only refer to networked objects and those have a PhotonView.viewID.
damn it
But .. the objects should not matter in this case. Being in the mafia or not does not relate to an object but to the player / client. So you could sync that via Custom Player Properties or Room Properties.
Each character that gets synced (for moving) has a PhotonView anyways and the PhotonView also has a reference to who controls it. So you know the Player and actornumber.
This is related but I don't know if it helps without further context:
https://doc.photonengine.com/en-us/pun/current/gameplay/synchronization-and-state
i read that document a bunch of times and i dont understand anything
like custom properties is a hard to understand as a math test
Well, I don't have any better way to explain it, really. You might need to experiment with this, without the burden of doing a complete game. In worst case, try to update a property and check what that does for the other clients.
The PUN Basics Tutorial may also help establish a few basics that may be missing. The terms and key APIs are explained there in some context, which may help.
Should a network with dedicated server be my first game?
No
Can you give some points why?
The complexity of a networked game is hard enough for even experienced developers.
For someone just learning how to code, making a single player game is already an enormous amount of work.
Hey so I'm trying to pass along a PlayerManifest that holds all the data associated with the player. So like when a client logs in to a server they then send username, player color, inventory, etc in a manifest file to the server that then syncs that data with all the other clients.
What is the best way to do this? I can't send an RPC without ownership of "something" on the client.
Is there some mechanism specifically for sharing initial player data that I'm not seeing? Or is the standard practice to do a data sync step after a player is all connected to the server?
Using MLAPI/Netcode for GO
Is it possible to dynamically add components to networked prefabs?
need to specify what netcode youre using
Mlapi
Can't find it in the documentation
I'm going through the Photon Fusion documentation, and something caught my attention. How's it possible to drag and drop a prefab into a slot with type NetworkPrefabRef? I thought the type of the slot had to be GameObject, and NetworkPrefabRef doesn't even derive from GameObject.
Unity can serialize component references
Huh, thanks Danny, I'll have to look into that!
What kind of component? MLAPI is very unlikely to care if the component isn't networked. Dynamically added networked components most likely need to be registered to the network view component, but no personal experience with that.
Afaik, Unity will find the NetworkObject component on the prefab and link this, as it's the only fit.
Hello good people, im trying to create a small 2d tank game, im moving the tanks via rigidbody2d, that means im using FixedUpdate, but my client does not seem to fire FixedUpdate, i cant really find anything on Google about this, can somebody help me ? 🙂
FixedUpdate is called on all active components. Confirm it by logging without any conditions
Networking shouldn't really affect this
Ok ill try thx 🙂
How can I properly set a gameobject's parent and sync it all over the clients and the servers of course as well.
Mirror
which multiplayer api is the best?
now just wait for any MP asset dev join the discussion with their "ours" comment
(you won't find many unbiased answers to that question)
basically, it depends on your needs. I was using unity's netcode (or mlapi). But now I am using Mirror, just because I found it easier to setup steam transport.
They are not too different.
i mean, the mirror staff and photon staff are in here pretty often, and no one is pushing anyone to use whatever library, just use whatever works best for your game 👍 😃
In Photon Fusion, anyone know what NetworkPhysicsSimulation3D does? It's not described in the tutorial or manual, yet it's used in the basic sample project.
Mirror has it's own Discord for support...link is in Mirror's ReadMe and in the Asset Store page.
Hi,
I'm working with photon pun 2.
I'm trying to sync OnAnimatorIK using PunRPC within this method.
But when doing this, it only works local but it doesn't sync with the other players, any idea why?
I'm also using the photon Animator view, but that shouldn't matter I think?
Hey, Im trying to have my players connect to my server with a name they set before they connect, however, in my code, all the players end up being named after the host
what am I doing wrong here?
answered in Mirror's Discord ^
Guys, is there an Ideal value for PhotonNetwork.GetPing which can be considered as a disconnection?
There is a callback to notify you of timeouts.
hi I can see this being a subjective question but I'm going to venture into networking soon and was wondering what's a good go to networking base for coop (1-4p).
For coop games, you may get away with some inconsistencies. The players work on the same team after all.
It depends more on what you want to achieve gameplay-wise. Which genre? How many characters, units, enemies, etc?
Hi guys, im implementing multiplayer via mirror in my game and i just cannot figure out this issue im having. Basically.. the host + 1st client can move around and the movement is happening on the 2nd client. But the second client is stuck and can't move. I know its cause the command/server code sin;t running but i just cannot figure out why, i've looked at that many tutorials and examples and my code seems 100%
any help would be great!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@crude juniperhave you tried Mirror discord?
i haven't but i shall now
just mentioning that in case one didn't know it exists, probably get more mirror users eyes on the issue there
mirror use two threads per client though thats wild
check the server authority flag for your network behaviour
it depends on what the transport does, mirror itself doesnt use threading
right, i was referencing KCP
kcp doesnt use threading, are you mistaking it for telepathy? (which does use threads)
yup! your right, telepathy
thank you for the clarification
im having trouble understanding the playfab docs for groups, im not sure what an entitykey is
thanks mate, fixed it up,
i watch some tutorial about photon, they pick photon PUN but i dont understand what it does, btw what other type does?
They all are diffrent things what i know..
example Chat & Voice stands for what they stands for, they are Chat and Voice add-on (I guess you can call them "Add-on")
Here's the diffrent between PUN & BOLT
https://doc.photonengine.com/en-US/pun/current/reference/pun-vs-bolt
Fusion and realtime is something else, try google it up.. I hope i helpt you a bit atleast (:
Photon Unity Networking framework for realtime multiplayer games and applications with no punchthrough issues. Export to all Unity supported platforms, no matter what Unity license you have!
when i build project with photon,this happen, i dont know what is this
Where's the build path?
u mean this?
No your folders
on your computer
Where is the Unity project on your files?
Example: C:\UnityProject
im sr but i dont know what file u need
When you click "Build" or "Build and run" you will get to choose path/folder, where do you choose?
ah, right here
Yeah, drag that back one folder
Do it in UnityWorkSpace
Call the folder Build or something there
like this?
oh,ok, i create
oh, it work lol, thank you xD
How to create offline menu scene and game scene?
When I connecting to host I should unload main menu and load game scene
Or how it should work?
What networking system? @slow lichen
Netcode for gameobjects
It is better netcode than mirror in performance?
Which performance metric?
my game was working fine with multiplayer connecting to each other but there was no player syncronisation as it had not been set up but when i do set it up the players no longer move by controlls at all the host of the server just jitters back to the oringal spot but other player wont move
i folllowed this:
https://youtu.be/AZRdwnBJcfg?list=PLhsVv9Uw1WzjI8fEBjBQpTyXNZ6Yp1ZLw&t=1122
Hello, has anybody had any success in syncing a string in Networkvariable ? Im trying to follow Dapper Dinos Playername tut and I cant really get it to work.
is there any way I can color text on a server build
you can use rich text formatting in debug logs ex: Debug.Log("<color=green>among us</color>");
It just outputs the string without using the formatting
This should get you going https://pastie.io/whhljy.cs
The colors part is in the ProcessInput method at the bottom but the rest is just useful 🙂
Hey guys! I am really new to Networking and I have a question about it. I just installed Photon and multiplayer to my game in Unity. I just found my first problem with it. My ragdoll player is glitching on the screen of the user. Only the ragdoll of the other player is glitching. I don't understand why this is happening. Can someone maby help me?
How do i make server like in Rust? I want it to run always even if the host disconnected
That is how dedicated servers operate by default
Unity's netcode for gameobjects, Mirage and Mirror are frameworks you can use to explore this
You need to compare the position values of the server and the client and figure out why the are not the same, I suggest looking at what the server is telling the client.
hey i have issue with photon network
when i join game i can move and rotate
but if someone joins game i cant move or do anything
and how to add here thing so if player leave the camera will stay in same player
Hello, I'm trying to implement **MLAPI **for a first time.
I achieved quite nice Movement for Host and Client players.
Now I'm trying to generate and assign color to both Host and Client.
I don't understand sync of NetworkVariable.OnValueChanged ->
- Host starts game, asks server to generate color. OnValueChanged is triggered and Client (player 1 - on the host computer) successfully changes its color.
- Client joins game, let's call him Player2. He asks server to generate color. OnValueChanged is triggered so both Host and Player2 successfully change color of the Player2.
2b. Client never gets information about Player1 color - so OnValueChanged is never triggered here.
Code: https://gdl.space/lolelesero.cs
Thanks.
You should really read the #854851968446365696 about posting code before people get upset 🙂
So if I understand you correctly, Player2 does not get the color information about Player1?
Yes. Exactly.
Do you get other information, such as positioning, rotation etc?
I mean, does Player2 get that information about Player1
Yes. I use NetworkTransform to manage Transform component on a different script.
Well, yes, I can see the correct color of P1 in P2 editor
Basically Server is not informing new clients about last state of the NetworkVariable
Okay, it seems that this color change is only transmitted on change, it also needs to be updated about all players when a player joins. I'm not well versed in MLAPI but basically however the position and rotation data is sent about old players to new players is also how you need to add color information on some kind of a join function. Does this make sense?
And this will probably be a recurring issue when you want to add other things such as health, weapon equipped and so on..
Not really as Transform is sent via NetworkTransfer class. That's something completely different.
Color is sent via NetworkBehaviour's NetworkVariable - which sync is not working on join.
Yep. I need to find out a way to make NetworkVariable sync every time new client joins.
It's fine, hopefully someone else will notice my call for help. Thanks.
How I should create main menu?
I should use NetworkSceneManager or just scene manager when I loading the game scene?
MLAPI
I need help with an error i get when i leave my match. This is a picture of the errors:
After i left the match, I cant rejoin another one.
How do you make the player leave?
And how do you make the player join/spawn?
Which version of PUN 2 is this? If it's not the latest 2.40, please update and check if the problem persists.
And like Nrex suggests, it's of interest to know how you ended up there. Are you using DontDestroyOnLoad for any object in any scene? And .. are you maybe using GameObject.Destroy in some place, instead of PhotonNetwork.Destroy?
@wicked fox
public void Leave()
{
PhotonNetwork.LeaveRoom();
SceneManager.LoadScene(0);
}
every player gets different playerManager in the scene which spawns the player
Would anyone know how to trigger NetworkVariable.OnValueChange for P1 when P2 joins the game as Client?
the roomManager gameObject is a DontDestroyOnLoad from the mainmenu to the gameScene but when i get back to the mainmenu it just dissapears
its the latest version
That is not something PUN would do. It must be somehow related to your code.
Sorry, I have no idea how something would "just disappear".
I have a working singleplayer 3D shooter game, pretty basic stuff with 1 player and 2-3 types of enemies with AI
How do I get started with making this game have networking with a 2nd player? Aside from adding P2's logic (which should be identical to P1, except maybe with small UI changes and obviously reacts to P1's attacks differently), will I have to refactor my entire game (or worse, even build from scratch), or do I just need to change a couple things to make this work?
Sorry if this is a vague question, but I just don't know where to start (have almost 0 idea how networking will work, except a vague understanding of basic protocols like TCP and UDP), and the Unity Manual seems to suggest multiple ways to handle networking
There are multiple ways to handle networking and how much you have to refactor depends a lot on how you built your game initially. It also depends on which networking solution you pick (cause all are slightly different).
There is no way to guesstimate how tricky it will be for any game, as there are endless ways to implement singleplayer (and then some more for multiplayer).
I would recommend having a look at the various networking solutions available. Take a few hours for your top 3 and build something independent from your main project. Then decide which one you'd use.
guys im looking to give a shot on learning steamworks.NET or facepunch.steamworks can i do the entire netcode using them or should i just use steamworks as a transport?
Is steamworks paid? or there are options, some are paid, other are not?
steamworks is free as long as you pay the 100 dollar fee to steam for your game
hey guys I am trying to get a dedicated server build to run on centos but it's not loading. any ideas?
I am using Photon, my game is fine but has bugs in reloading the game, the collision detection is slow and etc.
Please look at this video to see the game, I have shown the problem in the video
It is the errors
Thanks in advanced
im using photon, the math is :
i join a room A, if room A dont exist, create new room A
how can i fo that? im new to photon and dont know how to write
fo?
do?
yes 😅
That can be done by this code:
public void CreateRoom()
{
if(string.IsNullOrEmpty(roomNameInputField.text))
{
return;
}
PhotonNetwork.CreateRoom(roomNameInputField.text, new RoomOptions() {BroadcastPropsChangeToAll = true });
MenuManager.Instance.OpenMenu("loading");
}
This is the one i am using
And if the room exist, it will get you to the page saying the room already exists
so my title menu look like this
so we have to logic ourself?
Can you explain?
My project is like if you want to create a room, type a name and it is created.
If you want to join a room, You will see a list of room and click on anyone to join
um, let me have a look
i mean, there is nothing as OnJoinOrCreate?
if the room already exist, join it, if not, create one
oh, i found it lel xD
I dont know if it is there but you can do like if in PhotonNetwork.RoomList (Pretty sure it is like this) if name matches then join room, else create
okok
What did you do? Is there something like JoinOrCreateRoom?
a, yep, i found this, and it work
Hello. What the hell is this thing talking about ??? i just dont understand what it means
Are you using the Unity Editor as Host right now?
Btw, what Networking system is this? Im still a bit confused
Answered in Mirror's Discord ^
Hello People!
I'm using Mirror and NetworkTransform, NetworkRigidbody and NetworkAnimator for my player prefab. I'm having weird problems since yesterday. If I change the scene as the server (which makes everyone travel with the server, that's okay I want that), I get the error message "NetworkClient is not ready" on the Client and the client gets disconnected.
The error message seems to get called from the NetworkTransform script. I didn't have this problems two days ago, it just "appeared". Is this maybe a bug?
I made multiplayer with Photon, and when entering the room, two players are summoned and no movement is transmitted.
This has already been fixed for the next release of Mirror. Please join Mirror's Discord for support. Link is in Mirror's ReadMe and asset store page.
Oh! So it is a bug. Thank you!
im trying to disabled and enable object (using setactive) but it doesnt sync between players
Which networking solution?
photon 2 pun
objects that are disabled/enabled arent syncing for me in photon pun 2
you'll have to wait for someone who knows that package...I don't.
.... I don't know how I managed to do anything against it but I solved it somehow XD
What is the best most simple way to get kinda clean collisions using NetworkTransform and NetworkRigidbody? Pulling down the syncing interval works a bit, but I doubt that this is a way.
It doesn't have to be perfect, but avoiding overlapping objects would be a good achievement, since that causes clients to collide multiple times.
0.02 for transform & rigidbody
i still have overlappings tho, even if it's a lot less than the intervals of 0.1 before
maybe I should to this for you to see my answers xD
Wouldnt they still overlap just in.. bigger?
yeah.. lol.. good point.
i am using photon pun 2, and whenever i disabled objects (using .SetActive();) , it doesnt sync between players (meaning the other player cant see that the object was disabled)
how do i sync disabling of objects? i tried following a tutorial but it sent me an error saying "namespace "Player" could not be found" after i used: public override void OnPlayerPropertiesUpdate(Player targetPlayer ,Hashtable changedProps)
this is mirror, and Yes unity editor is my Host Right now
@ Anyone ... Does anyone have any examples or can point me to a good tutorial for PUN 2 item spawning & pickup? New to PUN and can't find much more that Player instantiation (and I already know how to do that) :S
Did anyone help you?
Did you get help in the Mirror discord? (vis2k)
yup am fine now but if you can explain what that meant that would be great
i was helped from the unity nerworking server
wait it was the mirror server
does anyone know a solution?
im using photon 2 pun
im using photon pun 2 and i cant find a way to use OnPlayerPropertiesUpdate() because it says the namespace "Player" cannot be found
is dedicated server mode like headless mode?
Yes, but it does additional stripping of systems that are likely not needed in the server build.
I don't really know any of Mirror but if i we're you i would search it up on google for example.. 🙂
ok so I connected the linux computer and the windows computer together. I'm not sure if this is possible, but I setup a portforward on xfinity on the linux computer. I can ping it with like 50% loss rate. Anyway. can I use that to host a server? or what would I need to connect to this instance from another machine off the network?
i have a problem with photon pun 2
the script i have is written ok however i am still getting an error "no suitable method found to override"
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
is there a way to instantiate an object, change a variable on a script of it, then spawn the object and have all clients versions of that object have that changed variable?
Hi there, Im pretty new to unity multiplayer and ive been experimenting with unity with 2d top down movements. ive ran into a small problem where IsLocalPlayer returns false on clients, what would be the main problem for this? Any help is much appreciated!
Which line does it say as error?
I am talking about Photon PUN. After Instantiation cache the gameobject in a variable and then call a function giving the value you want the variable to have. The instaiated prefab should have a script that would have the function and changes the variable. For reflecting it to other player, i would prefer you learn about Custom properties.
like gameObject a = PhotonNetwork.Instantiate(_prefab, _position, _rotation)
a.GetComponent<SCRIPTNAME>().myFunction("Whatever value you want to have")
_prefab should have a script called SCRIPTNAME (whatever you like), and the script should have a function to change the variable
'or'
You can do like
a.GetComponent<SCRIPTNAME>().variable = THISVALUE
thank you
how do i make it so that when i press "forward slash", i can type in the input field?
https://pastebin.com/7utsNKTF
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
line 78 (the line where i wrote public override void OnPlayerPropertiesUpdate...)
sorry for not responding ive been at school
So im using the unity netcode package and wanted some advice.
the game I'm working on is an auto battler like TFT and it requires it to be server authoritative so the server will run all the simulations and stream it to the client.
but i kinda just realised that when i build the code server code will be built with the client's code which probably will increase the size of the build.
is it fine to just leave it like that or are there any good practices
also how would one approach matchmaking
Simply get the connection URL and make sure your following the write protocol. Im guessing your using TCP so i'd suggest looking at this https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.tcpclient?view=net-6.0.
Not sure where to ask this, but my friend and I are having trouble getting Unity Collab to work with us. Our project wouldn’t sync on my end, so he sent the files over to me and they’re not syncing on his end. Collaborate is enabled and the package is up-to-date on my end, not sure about his end though. Anyone have any ideas on what to do?
Hey guys, anyone here willing to share some experience with Unity Relay? I'm trying to integrate it with our project for the first time and I'm struggling a little bit. I keep running into error messages that I don't know how to interpret.
public class ServerSocket :MonoBehaviour
{
string ipAddress = "";
int port = 54010;
TcpListener server;
TcpClient client;
IEnumerator doClient = null;
void Client_Connected(IAsyncResult res )
{
client = server.EndAcceptTcpClient(res);
}
private void Update()
{
if(client != null && doClient == null)
{
doClient = DOClient();
StartCoroutine(doClient);
}
}
IEnumerator DOClient()
{
int bytesReceived = 0;
byte[] buf = new byte[49152];
var stream = client.GetStream();
do
{
bytesReceived = stream.Read(buf, 0, buf.Length);
if (bytesReceived > 0)
{
string msg = Encoding.ASCII.GetString(buf, 0, bytesReceived);
if (msg == "QUOTE")
{
byte[] quoteOut = Encoding.ASCII.GetBytes("I am from server");
stream.Write(quoteOut, 0, quoteOut.Length);
}
}
yield return null;
} while (bytesReceived > 0);
doClient = null;
client.Close();
client = null;
}
void Start()
{
string ipAddress = "127.0.0.1";
int port = 54010;
Debug.Log("start");
IPAddress ip = IPAddress.Parse(ipAddress);
server = new TcpListener(ip, port);
server.Start();
Debug.Log("Waiting for clinet on ip: " + ipAddress + " port : " + port);
server.BeginAcceptTcpClient(Client_Connected, null);
}
}
``` idk what wrong with it , my server get hang when i try to connect to it
Hello
I think the function does not take in a simple hashtable as an argument
It takes special hashtable by Photon
It is like this
ExitGames.Client.Photon.Hashtable
Fine?
My code looked like this
Then I used OnPlayerPropertiesChanged override to make changes accordingly
I hope it is clear
dont worry i managed to fix it
can anyone checkout what wrong with this server socket , its keep waiting for client https://github.com/DevFrogora/UnitySocketCommunication/blob/master/Assets/Server/ServerSocket.cs
so like im a complete beginner in networking and i noticed they've given the wrong github link on the site to install the package i hit the copy button thing as well hoping that it would copy the legit github link but no luck
Works for me with that URL
im on version 2020.3
it just gave me a bunch of errors saying couldn't find the package you were looking for
i tried again after restarting and now it says that the package was found but there was some error adding it
guess i'll just restart it again and try
yep it works now
lmao
hey guys i wanna show the data of USD GBP and EUR in a table from this api
https://api.coindesk.com/v1/bpi/currentprice.json
any idea how can i do it ???
hello if i want to learn how to make a mmo like tibia and ultima online, is unity a good idea for?
Is there anyway to test my game without building it for a multiplayer game? (Server and client running at the same time)
Often you can run in host mode for basic testing. You can easily setup 2 editor instances with ParrelSync.
looking thank you
Network message is probably what you are looking for, since RPCs at least in the context of these networking libraries generally imply some specific gameobject instance, which you won't be able to do until you have spawned some objects with network identities of some kind
oh got it
in Godot we have autoload scripts
and we can call them like Foo.rpc_id("method", params...)
It's probably not that different once you are actually executing code on a gameobject that is a networked object, but the next message after OnClientConnected is probably not really tied to a networked gameobject, but more general client messaging
Haven't used netcode for gameobjects, but I imagine it just handles some stuff for you when it comes to sending custom messages. You can probably peek at the source to see what it is doing for you
it says it is not static
there are static functions
for adjusting objects
what if i need two connections at same process?
who are inventing these things?
is there a Unity engineer here?
im really curious
Unity just hire me
Yes, but users are not allowed to ping other people into questions. I would check out the dedicated discord server for Netcode if I wanted to increase the odds of relevant people seeing it
is there a Netcode Discord?
Yes, invite is in the pinned message
big companies are interesting
Join button is not accessable
am i at an impossible level of testing things?
or other peoples
can't do that
Hey that's on Discord 😄
yes yes
Jump to the message itself
just another money maker
im going to ask there
thank you so much
to be honest
Unity company managers
listen to me
Unity devs are copying project folders and linking them with symbolic links
to open multiple editors on same project
for just an empty scene
when i start NetworkManager server and client in two Unity editors
my fans are going crazy
im using 10 Godot editors with a complete game
one server and 9 clients
i can start multiple Godoot editors on same project and im able to debug all
and my fans are not going crazy!
this reason is a reality and it is enough to say Godot is extremely better engineered
i understand you are making unnatural extremely high level APIs and interfaces for making everyone able to make games
but i can't just do
Server server = new Server();
server.listen(port)
in your engine
there is no such API
this is not normal
open source development will grow
these kind of company management is not good for you
i don't want "click here, drag this and yes there is a cylinder and it is networked, it is moving for all clients without any code.... cool!!!"
so what is this approach for?
i understand but it is really interesting im not able to just start a server and connect it
So you want the engine to do everything for you, that sounds boring
what?
i mean Unity is trying to do everything
i just want natural lower level interfaces
Well you could have used the Unity Transport then
let me look thank you
This Transport workflow covers all aspects of the Unity.Networking.Transport package and helps you create a sample project that highlights how to use the com.unity.transport API to:
oh god
finally i see something looking "natural"
OMG
😱
i love you ❤️
does this thing have WebSocket?
¯_(ツ)_/¯
So I was following a tutorial to better understand Photon.pun and I have it working to a point. In the tutorial they mention using if(!PV.mine) to destroy the other players rigid body component so that the physics of the movement/jumping aren't calculated on both clients.
However, my characters have CharacterControllers and if I delete them, neither player sees the other player. Is there a solution to this? Must be some workaround right?
const int SPEED = 5;
[SerializeField] Rigidbody2D rigidbody2d;
[Client]
void FixedUpdate()
{
if (!isLocalPlayer) { return; }
CmdMove();
}
[Command]
void CmdMove()
{
// validate
RpcMove();
}
[ClientRpc]
void RpcMove()
{
float x = Input.GetAxis("Horizontal");
float y = Input.GetAxis("Vertical");
rigidbody2d.velocity = new Vector3(x, y, 0) * SPEED;
}
Hey, I'm new to networking and was wondering how I can implement basic movement validation for server authority? (using Mirror)
Your points are noted and here are a few thoughts on your comments:
- It looks like Unity Transport or another low level networking library is more alike what you are looking for.
- In regards to symlinking for opening multiple editors I'd personally recommend ParrelSync which is a tool that makes that process a bit easier. It's something we are looking into though and hopefully will be able to provide better solutions.
- Unity Transport does not support WebGL (no websockets currently)
oh thank you for response
Oh heck yes! Looks like FishNet is finally out!
how do i sync particles?
i am using photon pun 2
Hello guys i need some real help with my project, help with server dedicating and listing , 1- i wanna list my server so people can join , 2-Server run 24/7 itsa survival game pvp (we are stuck)
any help/tips ?
is there anyway to make the same terrain generation for more people on a multiplayer game?
i am using photon pun 2
Use the same seed
I am having issues with joining others on Android LAN. I am using Mirror. Firewalls are checked and fine. After failing to join, hosting and everything else stops working until the app is closed and reopened. But Hosting works just fine before joining. What could be causing this?
What? The seed should be the same for all players on a given server
Every different game can have different seeds, but if you want people to see the same thing, players who are in servers together both need the same seed for that world
Isn't that how Minecraft does it? Seed for the world data and then any specific changes
I feel you're running into a known Mirror bug, but I can't remember if that was fixed
I started looking into it, but then things happened and I stopped looking into the bug
I believe you're on the right track, but there's also additional data that needs to be loaded for the chunks too.
That would be info about blocks destroyed since generation, etc.
But if you seed the world the same across all instances, then you should get the same result... in theory.
guys how can i change the perspective for each client?
like the concept for it
i am remaking my first ever game, and im adding multiplayer
however, i want the perspective to change for the player or enemy
im thinking of just switching the id's
but it didnt work
Any tips how can i make online servers in my game and list them so people can join these servers , they cant make servers only pre-made “official” ? Like ark or rust
@shadow spoke Oh really? So what should I do? Should I make a bug report for the Mirror devs?
Take a look at the Mirror github known issue list, and if it's there, add your own notes to the ticket, otherwise open another 🙂
@shadow spoke Alright, thanks a lot!
Look into something like Node List Server, which is available at https://github.com/SoftwareGuy/NodeListServer. It's a web API that uses JSON to provide listings. For add/removing servers to the list, you'd only bake that functionality into official server builds, so any server binary that's "public" cannot register itself, for example
Other services exist too, but your mileage may vary.
Wow thats very helpful and how can i make dedicated server where the ip is public we made on but its local any tips ?
Thanks 🙏
You'd have to somehow get a public IP via an external API
Services exist that allow you to query it and it'll simply say "your ip is blah"
You should not be hosting official servers in your basement connected to the outside world via your ISP; use a $5 VPS from Vultr or Linode and learn a little Linux knowledge in the process
Unless you have a static IP and you also have port forwarding, you will have pain. Not to mention, your ISP might have something in it's terms of service that prevents you from hosting game servers on their connections for whatever reason (I've seen some australian ISPs do that)
Oh, and mobile network servers over 3G/4G? No.
What are you trying to do, and how does this affect networking?
Thanks
True
However, it is a very good real world test on how your network code handles turbulence 🙂
aight
well, i want to switch the the view for each client so they cannot see what its enemy attacks with, while also being able to attack himself
What do you mean?
how can i explain this
Most of the pokemon games when a player selects an option to attack or whatnot you get a "WAITING..." prompt
I'm thinking back to Pokemon Red and link cable days
You would select what you want to do, then the menu at the bottom is blanked with "Waiting..." popup window
Yeah, so? Why would they "switch sides" or whatever?
I have not seen any pokemon game switch sides in a online match in a 2D game, maybe in 3D pokemons the camera will zoom in and do action shots, etc
that kind of switch
it kinda sucks not having english as my native language
cant explain things
so basicly lets say
client one does not have a sprite for now
and client 2 is the circle
i want the client 2 to see the circle in the spot of the client one's sprite
and vice versa
ok this is the view for client 1
well thats good news
Off the top of my head, I would have two structs in memory that holds the local player and the remote player data.
These structs would simply be the UI data, like HP and whatnot.
could it work with scriptableobjects?
Honestly have little to no experience with that
But basically
you would have a script that controls the UI elements
Are you local player? Then you are closest to the camera.
If not? You're away from the camera.
i think starting in 3d would have been much easier
2.5D works, you can use bill board sprites like what I think some DS versions of Pokemon did
they had a 3D-ish environment but the sprites where 2D
i could have the sprites always rotate to the camera 🤯
that might look wierd and good
Another example is Golden Sun on GBA
that uses a 3D-ish rotation system, and the characters are scaled/zoomed accordingly
I feel though you should tackle the visual stuff first, then worry about the network bits
is there a way to go from a 2d project into a a 3d one?
yes, but it's recommended to backup your scripts and just start a new 3d project
I mean, there's a few switches you need to flick to get unity out of a 2D mode but it's easier to just use the fresh start
Hi, I am a beginner trying to make a 1v1 fighting game, but I am struggling with what I should send to the other player:
- Only our player's state / Ours and their state
- When attacking, do I just include an "attack" field in the data sent on the next state update? Or do I send a seperate message which would only contain the "attack event".
Any help/info appreciated! 🙂
what's the proper way to build a dedicated server in 2021? there's no more server build option, and I can't get the dedicated server option to fully run.
how do i sync particles in photon pun 2
does anyone knows how do we connect these servers after making them using node to unity so we can server list them in there?
Deterministic predict rollback only way to do fighting games which are worth a damn
Every other way is bad tbh
Your attack data should be sent as its own packet.
Eh… no, I mean.. it’s not really a relevant thing… “attack data “ all you should send is input
How it’s sent as long as it’s low latency without Head of line blocking isn’t really relevant
does anyone knows how do we connect these servers after making them using node to unity so we can server list them in there?
alright thanks guys, I'll look into it
hey i have issue with photon, when i join lobby everything i normal but when i join from other session i cant rotate and i dont see other player moving but i see when other player moves the boxes and its look like the boxes magicaly move
and when i shot i dont see bullet from other session
when i join the cameras are switching and when i leave it does magic too
Hey guys, I'm trying out relay right now. Since one of the players will be hosting my game on their machine under this architecture, I'm wondering if they can connect to it locally instead of going through Relay. I imagine that this would be more efficient and cost-effective but it doesn't seem to work when I try.
@cloud orbit "Connect to it locally" ?
You mean LAN play + relay?
You'd have to have two transports running
One listening for local connections, the other handling relay
Exactly. It would all be on the same machine but yeah basically a LAN connection
I didn't know that this would require two seperate drivers though. I figured I could use the relay one for both
I'll try that though. Thanks @shadow spoke
Terminology for that is "multiplexer"
still waiting for help
How do I create a mirror multiplayer chat? Do you have a tutorial video?
I'm sure there is a tutorial, I remember seeing it
True true! I remember learning that in networking class for directing messages to appropriate ports and machines but I suppose it applies here too
Hello, how do I make a multiplayer game. I know this is very general but like with io games how does it get people in the same server and stuff.
ok guisz
mlapi
or mirror
"Very general" might be the understatement of the year
Yes true lol
There's a lot of ways of doing it, some better suited to your needs than others
Unity has it's new official system, Netcode for GameObjects
Yeah i see. I will try to do some research
Then you have community solutions like Mirror and Photon products
Not very suitable for .io game environment assuming WebSocket support is still broken
I do kinda feel like you should have this down by now 😄
Howdy, there i got a problem with mirror, The cilent cant call some commands, but the host can What should i do . . . .
These are the commands clients cant call but the Host can
these is where am calling that Command
what should i do
What happens if you try?
Commands are sent from player objects on the client to player objects on the server.
https://mirror-networking.gitbook.io/docs/guides/communications/remote-actions
have you tried if (isServer) and if(isClient) and call the commands below the isClient statement?
Always worked for me before
How do i do that
I'm new to networking but this for example works for me, i call commands like this and non-commands like the isServer one
like this ...
and all of it inside if(isLocalPlayer) because you'd try to call it for other people otherwise
Kinda, but if the host is also a player you have to handle it in an extra if-statement i think
but I don't want to "teach" anyone, because i am new myself but this works for 3 players right now for me
xd am newer than you are Probably
thx for input i decided to try darkrift2
quick qn MLAPI and mirror which one works better
how do i install MLAPI now or is MLAPI just gone / changed to Net for gameobjects
Yea it was renamed
Let’s say there’s a game, in said game all players are put into 1 server, every single player online into 1 instance, would that be possible?
Sorry, I didnt know this was a whole controversy. I've just used fishnet before and thought I could give my opinion
good to know
👍
Mirror has a bigger user base than MLAPI, and the stack is better polished. Although it is best to review your options, and pick a network layer that suits you, I honestly out of the two options provided, would use Mirror if I was just getting started.
There are more than one way of doing things.
Pretty sure NetCode was a remake
Very possible but tons off your users will suffer from high ping.
Unity acquired MLAPI, made loads of changes (perhaps rewrote it) and then renamed it to Netcode for GameObjects
greetings, may i get a hand with netcode? im following this tutorial and got all right (i think), the thing is that when i use a unity's Character Controller the game doesnt work but when i apply transform they do work, is there a problem instancing Character Controller or something?
https://www.youtube.com/watch?v=GOtE96OKyVA&list=PLQMQNmwN3FvyyeI1-bDcBPmZiSaDMbFTi&index=3
Host works completely fine, but client conneting to host doesnt move just plays the animations.
Oh this is just a meme, I feel those io games kinda suck for how much money they make. I am not the real maker of those games, in fact im brand new to game development other than roblox. Ima dev in phantom of roblox idk if you would what that game is.
if you want to make io games your best bet is mirror, afaik mlapi and photon (fusion) dont support webgl
Well mlapi does but the webgl transport is broken i think
You could technically do it from scratch but probably not worth the effort
hi folks, can anyone help me on mirror and openXR, i been having problem with giving an authority to client to pickup prop for a while now is there any example on how to do it or an alternative, coz right now the client in my project can't interact with anything.
How can i get started on networking? I want to make a multiplayer game
Have you made games yet? I would strongly recommend releasing few singleplayer games to get that process down, since most developers fail already at that stage.
Easiest way to get started is probably by grabbing Photon PUN2 and consuming the manual and/or video content online.
Yes i have made a quiz , a single player rpg and tower defence typer game .
Can you help me with unity MLAPI ?
I haven't used MLAPI. Just ask your question and someone will help if they can. There's also a dedicated discord for it, invite link in the pinned message.
Where are the pinned messages?
Found it ,thank you 😊
Got it 👍
Here comes again
Which one is better btn mirror and Netcode
hello i did some basic networking stuff in c++ but i don't seem to be able to understand Unity's NetCode at all, i'm currently trying to move each player on its own client using the new input system.
in C++ i would do something like on the client get desired destination from UI, send message to server with my client id and desired destination and await response, on the server i would then check if its a valid move, move the client's player, and send response OK to client, client would then update its position on the UI
how would i do this in Unity? because it seems that the last client that i open is also running the code from all of the other clients, so i have to have flags all over the place with if(!isLocalPlayer) return; and for some reason the same piece of code is only moving my player on the host client, all of the other clients cant move, i guess that i have to make the position shared between client and server or something like that? and how would Unity know which client to move? I'm so confused.
write your own server software with sockets and connect to it with sockets
So is Multiplay like the new Playfab or what am i missing here
anyone know a good course for photon? I want to have a pretty deep dive in it. Haven't found anything yet.
Blackthornprod?
If i remember right he has one for free on Youtube
And one on Udemy?
Yea I saw that but is like an hour and doesn't seem like he does an dive analysis
if im gonna host my game with dedicated servers and listed servers in game do i need to buy servers or vps servers ?
I learnt it by reading the docs that is on Photonengine.com
most likely yes
we are trying to like make online survival game and listed servers in our game so its our servers and people can join them only they cant make do i need to buy like a whole server around 10k ? or it works with vps
you can just rent servers and pay more as you scale
You don’t need to buy a $10k a month server. You don’t even know if your game will make that money from day one
Grab a bunch of $5 Linodes or Vultr instances and use them, when you are at or over capacity then expand
I had a $80 per month rackmount and it was bleeding cash
i have very important situation that i need help with , im trying to make a server on my pc then list it in the game so when i join the game i can see my server running and no one else can make servers , but everytime i do it turns to be local and i give the build to my other friends they cant join , u have any tips ?
whats best ways to make it dedicated on my pc and list it?
You can use something like Node List Server I linked above in the channel a few days ago. Otherwise port forward the required port from your router and use something like ip.pizza to get your public IP address.
Using your own internet connection is a bad idea, for testing purposes it's OK but seriously just use a cheapo $5 linode/vultr linux instance and you're going to have way less pain
just testing we are trying
everytime it turns local we dont know why we port forward and still
You give others your public IP.
if u have time tmr can u check the code if u dont mind ? :/
Lemme take a look in my pile of stuff sometime, I think I might have a code fragment that might work
ok?
how do you deal with race conditions of NetworkVariables, if i understood them correctly they will be shared between server and all clients and lets say i want to do this:
/*** only change the light color when light is red ***/
/* client 1 */
private void Update(){
if(nv_light.color == red) ChangeLightServerRPC(() => nv_light.color = green);
}
/* client 2 */
private void Update(){
if(nv_light.color == red) ChangeLightServerRPC(() => nv_light.color = blue);
}
it could happen that the light changes from green to blue , or blue to green no? i don't know if this code even compiles but the idea is there
oh and also could anyone confirm if this would be illegal?
/* client 1 */
private void Update(){
if(nv_light.color == red) nv_light.color = green;
}
i got a problem because my machine is a bit too weak to run 2 hdrp clients at same time on it to test stuff what could i do
i can run 1 but 2 my machine becomes a jet
Hey! I need to add a websocket client to my unity app since it will be talking to a nodejs server as a backend. Can I use any C# websocket library and will it still work when i export it as a website?
I'm testing with 2 machines, if you got the possibility to do so try installing your stuff on another computer and test it like that
What do you guys think is the best way to implement a "punching" system? Like clicking on objects to punch them away. I got a working system, but the client sends a command to the server, which of course results in delayed reactions.
I'm adding a force to the rigidbody of the punched object as an impulse. The rigidbody doesn't have client authority.
obviously i dont lol
Hey what are some good multiplayer platforms that are good for big scaled maps and can support players and ai
mirror, photon, mlapi/NGO all good choices, depends on the specifics tbh, your use case is too generalized
How specific is specific so you can find the best one for me
I'm looking for server authority, has a good matchmaking api
Is able to have partys
And void
Also real-time mp do if you die the other client can see your loot etc.
@mortal horizon I was researching what do you think about photon fusion
photon fusion is built for team based games and competitive playstyles (csgo, valorant esque games)
i dont think it supports a ton of ccu per server since its fully server auth and predicted
What does ccu stand for
To give you a better understanding think of escape from tarkov
Something similar to that
ok then yes, photon fusion probably the best for that type of game, it has alot of built in stuff for that type of thing
I was thinking mmo since you said large maps
Yeah
yeah probably fusion then
Welp thx I wanted to think of these things early
Gonna work on the movement component and hopefully get it replicated
Thx man
yeah no problem, fusion should do really well with that stuff, and has matchmaking stuff built in too i believe (there are some photon staff that float around in here that can confirm)
Fusion is a great choice, just beware that when you get popular (exceeding their free tier limits) they’ll force you into a paid subscription as the free tier is good enough for testing. I believe it’s like 20+ players CCU? By that time though, you should be able to have some funding coming in and be able to afford their network stack subscription
I honestly want to look at Fusion sometime in 2022
Im trying to use Netcode as a starting platform for networking, and i'm trying to import a community extension which adds a NetworkManagerHUD. However I keep getting this error. Anything i could do to solve this. (Importing via git as said on the repo)
The full error message is hidden. Click the error and screenshot it.
The area below the list will reveal the full message; likely you don't have dependencies or something is unsatisfied
Hi, have anyone implemented functionally UNET in a published game? Does it really work for a professional project? If you did not publish any game with this internet system, do you know any real video game example published with UNET? Thanks a lot if you have info.
UNet is deprecated, and should no longer be used (It has been deprecated for years). You should use either the new official solution Netcode for GameObjects, or a community solution like Mirror or a Photon product
You're absolutely right. Believe me, I was thinking all the time NETCODE, and writing UNET, as I was awaiting for years for something like NETCODE, that it was my real question: **Do you know any serious professional project published using the new system NETCODE? **Thanks
I want to be sure before studying and implementing it
Not personally no, they have a Discord pinned here. I know Mirror is used for a lot of projects including a personal favourite of mine, SCP: Secret Laboratory
I see. But Mirror is a paid solution? do you have to paid for its servers I mean?
pay*
Mirror is free, however you must either host your own servers, allow players to host servers, or allow P2P connections
Photon has products which you pay by the amount of CCU
Netcode for GameObjects is like Mirror in that sense
If you really want something production ready, commercial products like the ones Photon provides are probably the safest bet
So NetCode is the new built in solution of Unity, but you have to have and external server, so it is not completelly free
None of this is free dear, you have to pay for something somewhere
Unless you let players host their own servers or use P2P
But really if you want your own servers, you should expect to pay
Thanks mates!
I was also said that Unreal servers are free, also for Unity-made games, do you know any of that? I mean, maybe I can program the internet staff with NetCode and use Unreal servers??
Epic and Steam do have free relay servers, but they primarily just relay packets and facilitate connections.
Someone still needs to be the host
All that said I guess I will have to study Photon
Afaik steam doesn’t do punch through anymore either
And is a pure relay
Which sucks for latency sensitive games
Soooo, I want to make pipe system that is similar to electricity circuits as works like lego blocks.
Here all important details:
https://github.com/bustedbunny/GasExpansion/issues/1
Any help with solution to this problem is appreciated.
P.S. no idea how to actually ask help with such questions, if you know I did smth wrong, let me know
what are you trying to achieve with this?
are you asking a question about a simulation of a physical network of pipes?
you might try asking that in #⚛️┃physics
Hi all, I'm having difficulty with WebSocketsSharp in Unity....
It seems that my ws.Send() is only being sent, once I call ws.Close()... but I need to stream often, and low latency.
Could someone help me work out how I can send, for example "hello world" several times a second?
Thanks
Did you have luck getting WebSocket to work?
Yes! I ended up using “Native Websockets” made for unity
That's good. Do you have a link to what you used?
I feel like I proberly tried that one, but I'm having trouble...
Could I see how you're sending your messages in your code?
Ps. Have a look just above to see my problem, and tell me if you had anything similar to my trouble thanks
I feel like I'm missing something obvious?
Maybe I'm not doing something correctly?
I followed the examples I saw... but dont understand why my ws.Send("Hello"); is only being sent when I close the connection...
Even if I do several in a row, like...
Ws.Send("hello 1")
Ws.Send("hello 2")
Ws.close();
All of the Sends arrive at the same time, just as the connection is closed 😭
You might have to call some dispatch messages method
Could you tell me a little more, I am not familiar with this terminology, in this context. Thanks
This is my code which is causing the issue. Thanks
Essentially there tends to be a method that you call to actually have all the messages sent
Ah yes, I wondered about that... But I couldnt figure out how to do it.
Do you know the method I can call on my ws object, that would trigger this?
What library are you using?
I tried two, and both had the same file name.
I believe they are called WebSocketSharp, and WebSocket-Native
It does seem like at least one of them implies that messages are sent just by calling send. In https://github.com/endel/NativeWebSocket at least there is DispatchMessageQueue()
Thanks for this, I'm going to try this now. However, can I just confirm.... Looking at that link to github you sent, how would 'you' download that, and install it into Unity?
I dont see the .dll in the files, theres no 'Release' or 'Packages'... Do I have to build this manually?
(When I googled originally, I had this 'native' one allready as a .dll file. But apparently is does not contain a definition for 'DispatchMessageQueue')
So I wonder if the one you linked is different? (which 'does' hvae 'DispatchMessageQueue' mentioned in the examples)
Thanks
Copying the contents of Assets folder in NativeWebSocket folder into your assets folder should do
hey guys, i have been having some issues wrapping my head around networking and such, have tried a few libs but not sure what to stick with. recommendations? I'm looking for something to support a 10-15 player survival world (procedurally generated)
mirror is the main one, mirage is based off of mirror. if you don't mind paying there are good paid solutions
https://github.com/endel/NativeWebSocket
....This was my latest attempt
But same behaviour
oops, wrong one
There, that's me latest one... Same behaviour...
Messages only delivered when ws.Close()
where are you receiving the messages?
On an ESP32-CAM, which is local, connected on my wifi, and receives just fine when I communicate with it via a a basic hello world python script
have you tried against the example server they mention in the package?
and are you using the .net 4.x runtime?
I haven't tried the example server because I need this working with the ESP32, and in testing, the ESP32 appears to be having as expected.
I've no idea XD
you can check in project settings
it matters because native websockets says they require it
Ok, I have switched that to 4
does the .net compile over to Android builds then?
ok cool thanks, I'll let you know what happens
I'm completely stuck, hit a brick wall... None of it's making sense, and I'm at a loss...
So I videoed exactly what's happening, hoping someone can help me figure out what on earth is going on here...
https://youtu.be/0OWzPHV2L-c
So please, if anyone can tell me what's going on here, please tag me, reply me, dm me, whatever it takes, thanks...
That's my next step
true
u got a text
?
in the video u posted i heard a vibration
ok?
Heyho! I'm implementing a hockey-like game where the puck has an own script to update position, rotation, velocity and angular velocity with syncvars.
My question is would anyone know how to implement an as simple as possible solution for a okayish-clean clientside gameplay?
Currently my idea is to update only the velocities and update the transform position and rotation IF the pucks position/rotation on the client is too much off
Can anyone please suggest best multiplayer networking API specifically for UNITY?
What’s best is always relative to your specific requirements.
I like mirror for selfhosted and photon for cloud hosted services, i really liked unet so mirror is very nice for me, in near future i will check out the new fishnet and i have to read about unitys new multiplayer api... but at the end it depends on your needs
Kind of game do you want to build - turn based, physics or player movement. Based on these you might arrive at your answer.
is this normal using Netcode? server is sending 10 bytes to clients and i'm pretty sure i'm not doing anything
mirror has a free relay thanks to epic online services btw
Do you guys not like Relay?
Asking because I just started using it myself
Also, if there are any experts around, I could use some help figuring out why I can't establish a local connection using Unity Transport
relays are great, haven't tried unitys that much, couldn't get it to work either haha
used to writing my own instead
Hmm so it's not just me? 😂
@cloud orbit fwiw i tried to use it outside of MLAPI, so that might have been the issue as well
I was expecting to make great progress on my project over the break but I started off with rewriting my netcode to use relay and I've been stonewalled by bugs
hard to maintain motovation
Same
I just want to use it to send custom packets
I had my own servers that I was hosting locally to do all of this before so I think we might have a very similar implementation
But I heard that relay is basically free if you don't have too many players so I decided to give that a go and spare people testing my game the trouble of having to host a server themselves
i know epic online services relay is free forever if you wanna try out their sdk for that
Mirror has an impl of it, but i'd assume you want to keep it custom
Honestly I'm very new to netcode so I can't say that I even know what I want with confidence haha. What I do know is that I don't need something like mlapi because I'm working on a turn based strategy game where the actions are infrequent and pretty strictly defined. That being said, I'm still pretty open on what to do beyond that (whether to roll my own solution, use Epic's, use Unity's, etc and whether to use a relay service or some other type of solution).
I thought about giving epic a go but I went with Unity instead since I'm more engrained in that ecosystem
Also I've rewritten this netcode like 3 times already haha
I've been hearing about mirror for a very long time too but my understanding is that it's more similar to netcode for game objects
Which isn't really what I need as far as i can tell
Yeah your game probably doesnt need it, ngo and mirror are very similar
Anyone uses Pun?
Photon
Trying to sync up a text gameobject for all players in a server room
tried RPC and Photon view, dont know if Im doing it right smh 😦
if anyone has info/experience appreciate it if you can help me out!
hi guys my unity mirror networking functions are not appearing in intellisense
like my class is inheriting from network manager
try rebuilding project files
im using colyseus and this happen, i dont understand it
Hey!
I'm going to model a databse in mssql. which tool is the best for modeling tables?
got any recommendation like web sites or should I download sql server?
thanks
@frosty crystal what do you mean by model?
hi guys, has anyone successfully networked with scriptable objects?
im working on a game that every 30 seconds a player on a team spawns the units they have built. So first round player 1 will spawn all their units and so will player 2. I am using photon.
The situation im trying to avoid is what if player 2 networks lags and cant send the information needed?
hi guys, does anyone know how to ... create scriptable objects onthe network? as in does it need to be instances per object or can the players ref the same one with different data? im not sure how to tackle it
So can I have user created servers in mirror
yes
Ok thnx
Generally I use them for static data and attach IDs to them for network communication. What are you trying to do?
what tasks does server side code handle in unity and what does the client side code handle
and when do i use remote actions?
thanks in advance
Hi Danny, sorry I'm pretty new to networking so just figuring stuff out a bit
basically i have a spell SO and my spells inherit from that, spell has a bunch of methods and data
i noticed that when i tested the game in multiplayer that the clients would essentially share the same SO asset, the symptom of this was that the spell would spawn in the same location (whatever updated the spawn pos last)
then i releaised that SOs are instanced or whatever and now im down the path of figuring out how to create them or.. pass the data seperately to themethods and do that way so the players can use the same SO methods and some data but the player will send in data over the network via the SO to get the spell going
not sure if any of this made sense but any insight you have would be great, i can provide more info but let me you know if what i said makes sense
Yea SOs by default lack the instancing, just like other assets in general. But just like most assets, they can instanced https://docs.unity3d.com/ScriptReference/ScriptableObject.CreateInstance.html
hmm i thought i tried this, but does this return the object? im trying to add it into a list....
The page and the method tells you what is returned. Yes, both variants return the cloned object.
sorry dumb question i see it now on the page
hi! thanks for that!
but now i have another problem.. im using mirror and i have now succesfully copied the spell into a new list and created an instance... but i need to give the player auth over that new object... the problem now is...
spell != gameobject and this fails...
NetworkServer.Spawn(newSpell, connectionToClient);```
instantiate(spell.gameobject)?
Is there any way to use the legacy networking system in a 2020 version of unity. I have a project that was developed in 2017 version and because of the networking it is not working in 2020.
Man I tried looking but I cant find any thing in detailed documentation on how to fix my scripts to work with mirror
So really noobish networking design question
If you do a Single/Local and Online Multiplayer game, how you handle the single/local part of it? Just create a NetworkManager and act as host and player or do seperate managers for online and offline mode?
ENet Transport question: is there a good way to build the DLLs for both windows and mobile builds?
Currently working on converting a project to have a mobile builds that uses the community ENet Transport layer and am running into issues where on mobile (android) builds the dll is not found and thus the project opens but cannot connect to the network
you should join the mirror discord, we have a family of over 11,000 mirror users over there ready to help you :) (you can find it on google, or in your unity console it will print)
you open a local host game with max players set to 1 and deny any incoming connections
that way you dont have to duplicate code
no, you can try mirror which is a continuation/improvement of UNET.
Ok thnx
Mirror is probably one of the best choices to get a older project that's not working with old UNET/HLAPI up and running in the modern day
community ENet Transport layer
What?
The transport layer for what networking?
Pretty sure you can get the android dlls off the github page
does anyone know why could i be getting this warning?
[Netcode] NetworkConfig mismatch. The configuration between the server and client does not match
UnityEngine.Debug:LogWarning (object)
Unity.Netcode.NetworkLog:LogWarning (string) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.3/Runtime/Logging/NetworkLog.cs:18)
Unity.Netcode.ConnectionRequestMessage:Receive (Unity.Netcode.FastBufferReader,Unity.Netcode.NetworkContext&) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.3/Runtime/Messaging/Messages/ConnectionRequestMessage.cs:79)
Unity.Netcode.MessagingSystem:HandleMessage (Unity.Netcode.MessageHeader&,Unity.Netcode.FastBufferReader,ulong,single) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.3/Runtime/Messaging/MessagingSystem.cs:241)
Unity.Netcode.MessagingSystem:ProcessIncomingMessageQueue () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.3/Runtime/Messaging/MessagingSystem.cs:260)
Unity.Netcode.NetworkManager:OnNetworkEarlyUpdate () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.3/Runtime/Core/NetworkManager.cs:1154)
Unity.Netcode.NetworkManager:NetworkUpdate (Unity.Netcode.NetworkUpdateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.3/Runtime/Core/NetworkManager.cs:1125)
Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.3/Runtime/Core/NetworkUpdateLoop.cs:149)
Unity.Netcode.NetworkUpdateLoop/NetworkEarlyUpdate/<>c:<CreateLoopSystem>b__0_0 () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.3/Runtime/Core/NetworkUpdateLoop.cs:172)
Thanks everyone.
This is the low level transport layer from this https://github.com/Unity-Technologies/multiplayer-community-contributions
With the other enet project and forks the process is straight forward in running the ndk build on the project and then adding the dlls to android builds. my confusion comes from this being handled by the package manager instead of directly added to the project. Are the steps different?
Steps should be the same. You should be able to just additionally add the enet android dlls to the project.
thanks mate!
Thank you!
Where is isServer set? My server is returning the wrong answer. I assumed it was by clicking Server Build under Build Settings, but apparently not... or something is overriding it
If you have a working StartServer written somewhere like linked to a button it should be set, don't forget that your server is also a client tho
What neworking
I'm using Mirror and have an OnServerPrepared that kicks off everything when Server Build is selected, but I just realized that isServer isn't being set correspondingly
how are u spawning it
Your network behaviour is on the same obj as network manager?
You can't have that, network manager cant have a network identity, which means you cant have network behaviours on it
Also, when spawning objects with network identity/behaviours you have to NetworkServer.Spawn it as well, not just instaniate
well that would explain alot
You should run through the quick start guide in the mirror documentation, or join the discord server (available on google or in unity console) :)
thank you very much!!!
no problem :D
Do you know if it's possible to decompile a Networking.dll
Why?
I'm trying to figure out how to change the max-connections from a lost file.
I don't understand what you're trying to do, sorry
I'll explain better. I'm attempting to change the amount of connections a server can receive in terms of players I'm not sure if I'm looking the wrong place. been a while since I last took a look at this
Are you trying to edit an existing game's assembly?
Yeah my existing game assembly. All the files went lost pretty much.
Been attempting to re-create things
Sorry, im assuming youre trying to use unet, which I don't know much about, it's been deprecated for years
for some reason my online game does not sync?
im using netcode for gameobject
i mean, the players spawn but when i move one, it doesnt move the other.
the network manager is in the scene and they both have network objects component
do i need to write the syncing protocol myself?
Most simple way is adding NetworkTransform to the players, if it's called NetworkTransform in the multiplayer library you're using xD
i tried that, it didn't work the first time but than i played with it a bit
and i managed to fix it
thanks!
although the camera is still broken, for some reason the input is only working on the first player who joins so i will try to look on that now
You may also need NetworkTransformChild for rotations etc. depending on your prefab
For the camera you should do something like
if (!isLocalPlayer)
camera.SetActive(false)
Assuming camera is your game objects name
oh that is smart! thank you so much!!!
That should solve the camera problem I guess :D
If you have to sync the transform of a child object too use NetworkTransformChild I'm just saying this because I lost days figuring out how to sync player rotations ... xD
i will go write some code now, thanks :D
Good luck!
MIRROR 55.3.8 IS LIVE ON THE ASSET STORE
Download: https://assetstore.unity.com/packages/tools/network/mirror-129321
ChangeLog: https://mirror-networking.gitbook.io/docs/general/changelog
Guys I'm still struggling with collisions right now. Currently I'm using NetworkRigidbody and NetworkTransform for the players and the object they have to play with in a collision based game.
The clients however, can not collide properly, they get pushed upwards by the object. Removing NetworkTransform solves this, but desyncs the object.
Extrapolating the rigidbody and only interpolating the position & rotation helps a lot, but is inaccurate tho
if i call a [ServerRpc] function() from a client, will it execute on the host?
Yes it should that's the function of a ServerRpc i think
I'm using Mirror and [Command] is the same i guess
I am using MLAPI and want to replicate a reference to an assets: e.g. a prefab, an image, a scriptable object, etc. This asset is on disk for all clients. Is there something built in I can use to do this?
I guess I'm wanting to replicate the asset's global object ID?
Ah no that's editor only
you can write a system to create an id based on the prefab name or something, keep a runtime lookup of all of them, and then just sync id
in my experience i will hash the prefab name and turn it into a unique id and send that over network
I'm so shocked there's nothing like this out of the box
I don't understand why unity puts all the unique id/asset management stuff behind UnityEditor, this stuff should exist at Runtime
Can I use mlapi with Unity webgl?
Hello everyone! Where "Rotation axis" is like in Unet, only in the Mirror > Network transform?
Hey, I have a problem with Photon, how to resolve these errors?
Multiple precompiled assemblies with the same name Photon3Unity3D.dll included or the current platform. Only one assembly with the same name is allowed per platform. (Assets/Photon/PhotonLibs/netstandard2.0/Photon3Unity3D.dll)
Multiple precompiled assemblies with the same name Photon3Unity3D.dll included or the current platform. Only one assembly with the same name is allowed per platform. (Assets/Photon/PhotonLibs/Photon3Unity3D.dll)
MLAPI itself is fine, but the UNet LLAPI transport's WebSocket implementation is broken IIRC, so you might need to replace the transport.
No idea if there are community websocket transports available for MLAPI
hi guys, im having trouble understanding something...
i have a player prefab with a list of spells on them, i drag and drop spells into the list via the inspector to populate their spell list
my client+server can cast spells no worries but my client cannot
when the client connects /starts etc.. i init each spell and generate a spell id for each spell, when the player tries to cast a spell they just pass the id from their spell list, the server does a lookup using the spell id to find what spell to use.. for the client+server this returns the spell.. but for the other client it returns null.. makes sense cause the list is only on the client side...
im struggling to understand if i should have a networked list of spells with all the spells from all the players or... just sync each players spell list?
i tried using synclist and various other methods but i couldnt get them working... does anyone know how i can solve this?
SyncList so it sounds like Mirror or what are you using?
im using mirror sorry
synclist wont work though cause i need to use a custom type (spell)
Whats the best tutorial/walkthrough for netcode for gameobjects currently available?
aside from unity documentation
bruh I've just been having to read code
very little documentation
if you have questions I might be able to help
i understand it atm, just love getting every peice of knowledge about it first
yeah you just gotta read code, most of it is in C# luckily so it's available
sweet, although one quick question, implementation with playfab, how much effort is that(if you have done anything with azure playfab before)
yeah true
one question related to netcode then, cause may aswell ask rather than spend an hour figuring it out
On netcode, everything playerwise syncs fine(with latency it seems) however, a scene object that the player can pickup doesnt sync unless the host does it
i have noticed that the objects networkobject component has "owned by server" as true, will this be effecting it, and if so, how do you go around making an object owned by everyone
That's unfortunately not how it works. The server should be the one owning most of the NetworkObjects in the world
What you need to do is have a ClientRpc which the client calls when they want to pick up an item. THEN the server will run the code to execute the pickup and the deletion of the gameObject (this deletion will automatically get replicated since it's a NetworkObject)
The sideeffects of the pickup need to also be replicated from the server side - meaning that if you add an item to the inventory or something, the inventory should be replicated
The client should run 0 game code that executes the pickup in an authoritative way: e.g. setting game state data. All of it should come from the server
Hope that makes sense, this isn't a specific bit of code you need to change, you need to build your code around the paradigm that the server owns everything and the client communicates with ClientRpcs
Hi
Unity multiplayer system
Can I use this for like 30byears from now or is it's just for a short period. I ain't saying this for money but I read this somewhere that unity multiplayer system Is closing and that we use photon nowadays?
Can anyone tell which one should I use?
netcode is very new so shouldn’t close in a while and should only be built on for at least a long time
mirror is also free and just got updated two days ago
Yeah I know.
Netcode?
Is it free
Like for development you get 20 players free or something like that
lol i meant like physically hold kind of pick up but that answers it anyway, just need to launch that from server side and call from client
yep as many as u want as long as u host ur own servers, only pay for like azure or aws hosting
oh yeah, same concept
sweet thanks
the "side effects" I mention still apply, all that needs to be done the server
In unity pun is it possible to set up a queue to only let a certain number of players connect at a time?
Hello everyone! Where "Rotation axis" is like in Unet, only in the Mirror > Network transform?
Like this
anyone know? 😢
generally, the server needs to know the spells, the clients all need to know at least some ID that the server understands for each spell. those can be hardcoded. if you want to validate which player can use which spell, you maintain a spelllist for each player on the server and sync that via RPC or NetworkVariable. Whenever a spell is cast the player that should cast will send an ClientRPC to the server requesting that spell cast, the server does the spell cast and syncs the result back to all clients via network spawn and ServerRPCs.
thank you that generally makes sense to me i think i will ned to use an RPC cause i cant network var a list of type spells, thanks again
player can mean the actual app/game that the client PC runs or player as in the avatar/localPlayerNetObject in the app that represents the local client PC or player as in the person sitting in front of that local PC, potentially controlling multiple player characters inside the game that all are handling their server comms through a single localPlayerObject
that makes sense, keeping that in mind
i think i will init the spells on the server.. then send the spell ids that the player should have to the player and add them to another list then pretty much do what im doing already? i think
yes, network variables just try to encapsulate/abstract that process a bit
how can i access the local player's Network object?
i tried
NetworkObject ClientObject = NetworkManager.Singleton.ConnectedClients[clientId].PlayerObject; but it didn't work because only the server can access "ConnectedClients"
just updated to the latest version of netcode and I started getting this error
ok f.. this im done for the day im out
probably while updating some of the referenced network objects/player prefabs lost their reference. try referencing stuff
alright thanks i'll just fix this tomorrow im done lmao
lmao
if anyone knows it will really help :)
Hello everyone! Please help me! I have an error that there are several audio listeners on the stage. I want to add it to the "Components to disable" array, but I can't put it there. What to do?
This isnt networking related, but anyways, you can't access scene objects from the prefab editor
@delicate iron
Sorry. And how can I solve this error?
Hi, I am working on a multi-control game, kind of like the dream 2 player controlling one player video.
How would I load in my player? If I want 2 players to control one character, what should I use?
transform view? RCP?
I tried the Photon transform view classic, but after toying around I can only seem to get the horizontal Camera to sync up 😦
Im using Pun from Photon btw
Thank you! But in which script?
Whatever script you want, I don't know how your game works
In which list?
Thx
Im trying to understand the RPC calls from the netcode for gameobjects documentation, however i dont exactly understand it. What is the process of for example when a client clicks move an object for every client
@runic rampart
Hey sorry
Ok so this is what my setup would be
- I have a prefab which are the objects the clients will move. They have a NetworkObject component and a NetworkTransform component.
- I have an RPC somewhere that looks like this
[ServerRpc]
void MoveObjectServerRpc(NetworkObjectReference ObjectToMove)
{
ObjectToMove.TryGet(out GameObject go);
go.transform.position = ...;
}
And somewhere when the client clicks on the object you call
MoveObjectServerRpc(gameObject.GetComponent<NetworkObject>());
Hope that makes sense @glass lichen
When you set the transform on the gameObject, the NetworkTransform component will automatically sync the position on all clients in a smooth way
Not to say you haven't read this but reread this page https://docs-multiplayer.unity3d.com/docs/advanced-topics/message-system/execution-table
The following table details the execution of ServerRpc and ClientRpc functions:
haven’t seen that doc thanks!
having trouble getting the gameobject from a network object. your way throws Cannot convert from unity gameobject to networkobject
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
This is the current code i have, atm it doesnt do anything on click
with this calling it
In update
Putting a debug.log in the function, doesnt look like it is getting called at all
anyone ever had problem with network objects not using gravity? even though use gravity is enabled
i have disabled it once in run time via script however i have taken that out so it shouldnt stay enables.
nvm i had is kinematic enabled
You need to get the Network object component. I would highly recommend using a plugin like Resharper or an IDE like Rider
it’s all sussed now, kind of like set it to a local variable of network object which then got the component from there
yeah either one works
Hi,
I am trying to create a game where 2 players can control the same character, where one player controls the movement, and one player controls the interacting and other things.
However, right now I am trying to get the Camera to sync up with both players
Essentially I would want both player clients looking through the SAME Camera.
I played around with RPCs but realized that it is meant for infrequent calls thus making it quite impractical for an EVERY frame update
Im also trying “Photon Transform view (classic” and applying that to a photon view component.
It is not quite working and Im kinda stuck right now, any ideas?
Thanks!
That idea might be a bit tricky. Especially, when movement corrections need to happen and the "interacting" player's screen moves away from whatever was the target...
Aside from that, it should be doable.
Basically only one player has a character to move. The camera needs to be attached to that and the second player's input needs to get ignored for it.
I don't actually know if PUN supports sub-objects being controlled by another client, so that may be an issue.
I would not use RPCs for the second player's movement anyways. Just use RaiseEvent and send some event content that describes what the arms do and which interactions there are.
found a few fixes on my code
but how do i change something from a gameobject after PhotonNetwork.Instantiate?
I did GameObject a = PhotonNetwork.Instantiate but it doesn't change it in other clients
does anyone know why am i getting this error? (Rpc)
Unity.Netcode.NetworkBehaviour.get_NetworkManager () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.4/Runtime/Core/NetworkBehaviour.cs:219)
rpc.MessageClientRpc () (at Assets/rpc.cs:51)
rpc.Update () (at Assets/rpc.cs:24```
```csharp
[ServerRpc(RequireOwnership = false)]
private void MessageServerRpc()
{
if (NetworkManager.Singleton.IsHost)
Instantiate(SpawnThis, new Vector3(3f, 6f, 3f), Quaternion.Euler(new Vector3(0, 0, 0)));
else
Instantiate(SpawnThis, new Vector3(-3f, 6f, 3f), Quaternion.Euler(new Vector3(0, 0, 0)));
//Debug.Log("Ive Got This Running In My Server");
}
i did reference SpawnThis and serialized it.
Which line is the NRE on?
Hey everyone! hope everybody is having a nice day 😉
I´m a little of trouble about how to use the network variable with Unity Netcode preview 1.0.0_4
how does it works? how do I update values from server side to client side? I´m a beginner on netcoding.
https://gdl.space/ujohemuyih.http <- this is the sample of my code, just the important parts.
Does the doc answer your question ? https://docs-multiplayer.unity3d.com/docs/0.1.0/basics/networkvariable/index.html