#archived-networking

1 messages · Page 102 of 1

ionic panther
#

One of the things with RPC for object initialization is also that there don't seem to be a way of having a function that calls everyone (client AND server), so I basically have to do a public Initialize(...), and in it call a private InitializeInternal(...) and also a [ClientRpc] private InitializeClientRpc(...) {InitializeInternal(...);} to initialize on all sides (effectively initializing in InitializeInternal) if I want to avoid duplicating the code. It would have been practical to have like a [EveryoneRpc] to avoid having 3 initialization functions every time, but well, it's probably still better than adding OnValueChanged callbacks for every variable that is only set once.

verbal gorge
#

Been using mlapi to get clients together and synced up, but I need to save player information for future retrieval.

Not sure if this is the best place to ask, but does anyone have information on how to create a login/register system to a database securely? (with the intention to save more information later)

Or if this is a bad approach, I'd like to know alternative methods of saving player information, so that players cannot access / copy it.

willow lark
#

im using MLAPI with cinemachine free look however the server doesnt spawn any players, and if 2 clients join the main camera starts to follow the last one that joined. It's been a couple of days and i couldn't find a fix for it yet. Does anyone have an idea why that would be happening? This is the movement code: https://hastepaste.com/view/9gvDPjVdG4

verbal lodge
#

Don't use Start use NetworkStart IsLocalPlayer is always false in Start because it is not initialized yet

willow lark
#

should i override it?

verbal lodge
#

Is your player object registered as a network prefab in the NetworkManager and did you check the player prefab flag?

#

Yes you should override it.

willow lark
#

the only problem is the camera starts to follow the last person that entered

#

but the movement is perfectly normal

verbal lodge
#

Changing to NetworkStart should fix the camera issue

willow lark
#

fingers crossed

willow lark
#

im guessing it worked but since the server doesnt spawn a player im guessing i have a different issue

verbal lodge
#

Do you have a player object in the scene or how did it work in the first place if no player is spawned?

willow lark
#

its a prefab and its attached to the network manager

#

the server side didnt spawn before either

verbal lodge
#

But you said the camera follows the last person who entered? But there is no player object spawned?

willow lark
#

but not server

#

now none of them spawn

#

maybe i should add a main camera to check and see if they actually are spawning

#

gimme a second

verbal lodge
#

Well on the server IsLocalPlayer will be never true so you never attach the camera. It makes sense that you don't see anything

willow lark
#

ok i attached the camera and tested

#

when the server starts there are no players as you explained it

#

once i start client the player object spawns in server but not in the client

#

i started the another client which i assume spawned another player on the server side but not on the client

verbal lodge
#

Are you sure the clients have no players spawned or could it again just be a camera issue?

willow lark
#

im sure the clients didnt spawn them

#

because i added a camera to the scene covering the entire plane

#

nor the cameras switched to the player

verbal lodge
#

Can you run a client in editor and check for error messages or if there is really no GameObject around for the player?

willow lark
#

yeah gimme a sec

#

i dont get any errors and the object hasnt spawned

#

i should probably just record and send it tbh

blazing geyser
#

So i startet an litte multiplayer test project today and used the MLAPI package. I sett averything up and add my own moovement script to the player.
But when i start it and join as a host in the one tab and as an client in a nother tab and i hit anny w a s d key, the player just speeds out of the camera angle and comes back with an nother player parallel to it(only in the tab, where i dit it tho) same for the other tab. What am i dooing wrong??? (i also have a video: https://www.reddit.com/r/Unity3D/comments/o7uazk/mlapi_wierd_problem/)

willow lark
#

maybe its how i get the components

#

i have a question if my GFX, camera and free look camera under the same gameobject of player do i need network transform for all of them as well?

#

i am missing one for the GFX

fading zinc
#

hi people im having quite a riddle. lets say i have a game and in this game people can host their dedicated servers

#

but i want people to have items for example. like cosmetics and different things and also data. i want those to be global

#

i have a server machine at my disposal.

#

but im not sure whats the best way to archieve this in plain sockets

#

i basically want to have a server wich has all people's cosmetics and data. but when someone creates a server on his own (dedicated) the server picks up the player's data

#

at the same time i want this to be secure. and i have no idea how to do it

#

i also need some sort of authentication system. i already have one but its not enough for long-term use. basically when you join a server. you need to register with a name and password. then when you join you input those

#

and you have your data

verbal gorge
ionic panther
#

Is there any reason why my MLAPI client RPC is never called when the server calls it from NetworkStart()? It works if I call it in a coroutine after doing a yield return new WaitForSeconds(3), so it seems timing-related somehow?

fading zinc
#

that seems what im looking for!! thanks

#

it might be adaptable to what i need!

midnight latch
#

unity mlapi is a good choice for mmo?

#

or it's best still in node js

#

?

grave ice
# midnight latch ?

nodejs and mlapi is incomparable, you could use mlapi as your client side code library and nodejs for udp server side

weak plinth
#

hey i need some help with fizzysteamworks

#

so i have mirror and fizzysteamworks setup with a script that when i hit a button it spawns a player prefab and allows steam friends to join. i tested it and wshen i joined from another device it spawned another object, but the movement was happening seperately from the host and the client

#

here's my movement script and the steam lobby script

#

lobby script(taken from this https://www.youtube.com/watch?v=wpHRcj9yATc video)

In this video, we're taking a look at a quick and simple guide on how to add Steamworks to a Unity Project so that you can connect and play with other Steam players inside of your multiplayer game.

Facebook: https://www.facebook.com/CGDCGame/
Instagram: https://www.instagram.com/cgdcgame/
Twitter: https://twitter.com/cgdcnews
LinkedIn: https://...

▶ Play video
high rose
#

Hey everyone! I'm just getting started with multiplayer, was wondering what the difference between a host and a server is? Couldn't find a decent answer anywhere. Thanks! (Please ping me when you respond so I see it)

ionic panther
#

I don't understand why my LMAPI RPCs don't work, it's giving me headaches. I have a simple 3D object in my scene with a NetworkObject component and a TestClientRpcStart component (here https://dpaste.org/6HK5), I just call a ClientRpc in NetworkStart() and the call is never received by the clients. I make sure to start the client first, but the call is never received, I don't see my log.
If i call the client RPC in a coroutine started from NetworkStart() and that I wait like 2 seconds, then it works. So it looks like NetworkStart() is too early to call RPCs? But I thought it was the recommended way of doing it.
I even created a new project with the simplest setup possible to make sure it's not a library or something else that messes up with MLAPI, but I have exactly the same thing there.
What am I doing wrong?

cobalt python
#

Hi! I have a question about pun: there is rpc function to extinguish torch on wall. RpcTarget.AllBuffered. So new players see the state of the torch. However, if player that switched that torch rejoins, sees this torch lighted up again. What is the problem? Function:

[PunRPC]
        public void ExtinguishTorch()
        {
            flameSpriteRenderer[0].enabled = false;
            flameSpriteRenderer[1].enabled = false;
            flameLight.enabled = false;
            flameSound.enabled = false;
        }
ionic panther
ionic panther
cobalt python
ionic panther
pastel marten
#

Im using PUN 2 and I'm acessing my players photonview through a script on a different game object, but the photon view never returns as is mine, eventhough it should, how can I fix this?

cobalt python
uneven root
#

I am receiving two errors with the "Photon Network Package".

Error 1: Assets\Multiplayer Package\Photon\PhotonVoice\Demos\DemoVoicePun\Scripts\SoundsForJoinAndLeave.cs(11,26): error CS0115: 'SoundsForJoinAndLeave.OnPlayerEnteredRoom(Player)': no suitable method found to override
Error 2: Assets\Multiplayer Package\Photon\PhotonVoice\Demos\DemoVoicePun\Scripts\SoundsForJoinAndLeave.cs(20,26): error CS0115: 'SoundsForJoinAndLeave.OnPlayerLeftRoom(Player)': no suitable method found to override

Code: ```using Photon.Pun;
using Photon.Realtime;
using UnityEngine;

public class SoundsForJoinAndLeave : MonoBehaviourPunCallbacks
{
public AudioClip JoinClip;
public AudioClip LeaveClip;
private AudioSource source;

public override void OnPlayerEnteredRoom(Player newPlayer)
{
    if (this.JoinClip != null)
    {
        if (this.source == null) this.source = FindObjectOfType<AudioSource>();
        this.source.PlayOneShot(this.JoinClip);
    }
}

public override void OnPlayerLeftRoom(Player otherPlayer)
{
    if (this.LeaveClip != null)
    {
        if (this.source == null) this.source = FindObjectOfType<AudioSource>();
        this.source.PlayOneShot(this.LeaveClip);
    }
}

}```

pastel marten
pastel marten
restive geode
#

When using MLAPI, how do you spawn an avatar that has player functionalities for yourself but spawn avatars that has no player functionalities for the clients joining in the room?

cobalt python
#

how to make more than 4 players per room in PUN? The 5th player creates his own room

spring crane
#

Did you check the max player count for the room?

grim jackal
#

Looking for some advice on websockets, has anyone used System.Net.Websockets while targetting iOS/Android?

Wondering if it's made the use of websocket-sharp obsolete "now" we have .NET Standard 2.

sharp willow
grim jackal
sharp willow
grim jackal
fair linden
#

Hi im building an online game and im using my monitor which is sharing a screen to my laptop but when i load both players in and they start to jump the player jumping it looks good but on the other screen it looks like their lagging can someone help

#

also to add to that i have my player in if the player flips wen he turns either left or right but the other client dosen't see that so it looks like he's running one direction can someone help

#

hello?

verbal lodge
#

I'm just a random Unity developer, I'm not "Unity help".

fair linden
#

oh but can you stil help

verbal lodge
#

I can try, which network solution are you using? Most likely you are not buffering and interpolating position updates.

fair linden
#

im using photon

#

and the input system

verbal lodge
#

I don't know too much about PUN. I think they have something called "Simple" which you put on top of PUN to get smooth position sync..

fair linden
#

oh ok well i'll search that up so ill know where to put it

#

couldn't find anything

spring crane
#

@fair linden Unity doesn't offer support here, but some employees might choose to do so by answering questions posted here.
While on the topic of employees, employees of Photon are probably keeping a closer eye on the Photon discord.
You are more likely to get help if you provide all the information upfront, like code and videos of the issue.

fair linden
#

so should i go on the photon discord then

still brook
#

Okay, pretty new and considering making my game in unity, but it will be sort of like a mini mmo. Does MLAPI or whatever support a dedicated server that can handle 100+ players, with significant amounts in one area?

If not, what unity solution exists that could? Mirrors?

spring crane
#

Mirror at least have been known to test for that use case and they advertise themselves for it. No idea what MLAPI focuses on, but I wouldn't be surprised if scaling wasn't the highest priority atm considering the things they could be providing for non mass scale games.

#

If you do opt to look into Mirror, you might wanna check out Mirage

still brook
#

Awesome, thanks. Ive got mirror and mirage on my list to checkout then. I heard photon is an option but seems older/heard it might have issues with message rate or something

#

Oh wow, i didnt know secret lab used mirror

cobalt python
#

Hi! I have a problem with compiling, whats wrong?

#

here is the line:

using UnityEditor

itemPV.RPC("SetItemName", RpcTarget.AllBuffered, ObjectNames.NicifyVariableName(item.itemType.ToString()));
frosty crystal
#

Hello.

#

I am try to understand the token consept.

#

Can I acquire a token from AWS server and convert it into binary to store local storage, so in the second session, I could check if it is valid.

#

this approach is true?

#

thank you

brazen canyon
#

@cobalt python ObjectNames class inside of an Editor folder or wrapped in an #if UNITY_EDITOR perhaps?

glacial finch
#

Hello guys. I am trying to make a multiplayer 2-d strategy game with a 1v1 format in Unity. (I would like client to server to prevent/minimize cheating. )

Am I better off with Photon or Mirror?

junior willow
glacial finch
junior willow
glacial finch
junior willow
#

Then they're both gonna be the same probably

glacial finch
#

for cheating prevention

junior willow
#

Oh

#

You have to implement that on your own

glacial finch
#

yeah okay

#

thanks for your help then

#

will look into photon

junior willow
#

You're welcome!

silver peak
#

Hello, I am looking to make a multiplayer game where a only a few floats need to be stored server-side. What systems out there would work for this? I do not have very much networking experience. Would I be able to use something like PUN to get/set variables?

spring crane
#

@silver peak As in some sort of persistent thing?

silver peak
#

@spring crane No, just short matches...no need to store the data for any longer than an hour. I was hoping to stay away from having to use a database like mySQL.

spring crane
#

PUN out of the box can deal with storing data during a match. You don't really have server side logic by default though

silver peak
#

would this be something troublesome to write? I haven't used it before but I do see there is quite a bit of documentation on it

spring crane
#

Well networking can be a bit daunting when starting out and it can get quite complex too. Sending a value over PUN to other clients is not terribly hard though.

#

PUN comes with several ways to keep values in sync and handles a lot of stuff when it comes to scene, connection and networked object management, so a solid documentation needs to be somewhat large.

#

You can ignore vast majority of it if all you wanna do is sync few values

silver peak
#

Well that is good to note. I pretty much just need a lobby/mm system and then the few variables once in-game. Thank you for the input! much appreciated!

silent zinc
#

Can anybody suggest me a language within: Python, Java, C#, C++ for building a game server? I'm concerned about physics simulations, and overall performance and memory management. What language can i use to simulate Unity Physics, or any game engine physics? Does Unity Physics API work with a plain C# software? What about C++?

#

Thanks in advance for help!

still brook
#

Sorry, sort of adding to this question myself: dont photon/mirror have physics simulation?

silent zinc
#

I'm not using third party networking libraries tho, since i want to integrate my own protocol.

gleaming prawn
#

photon = company, there are many different products

frosty crystal
#

Hello.

frosty crystal
#

Is this logic correct?

#

I am thinking to embed my taken token into bytcode and check if it is valid.

#

"acquiring token by facebook" provider is little bit below. This diagram for the entry.

analog shoal
#

Have you implemented client/authorization server based realtime games?
If yes, what character controller do you use? I need deterministic one
Character controller is not deterministic and causes some server-client conflict and mismatch even when inputs are the same in the client and server, final states are different

analog shoal
eternal cave
#
        WWWForm form = new WWWForm();
        Debug.Log(GetToken());
        form.AddField("Content-Type", "application/json");
        form.AddField("Authorization", GetToken());
        using (UnityWebRequest www = UnityWebRequest.Post(API, form))

How do I set request's headers? I can't find any non-deprecated documentation on this.

edit: found solution
www.SetRequestHeader(header, headercontent);

loud grove
#

how do i sync 2d objects in a multiplayer game? im using photon pun,
any ideas?.. i tried putting in in the observe of photon view but its not in the right place on other device

#

what i currently do is i sent its position through rpc but not sure if this is the right way

ancient iris
#

Yo whenever my friend tries out my multiplayer game and joins the lobby he always joins but he's always like binded another player and they are copying each other

#

idk why

#

and from my end it doesnt sync the movement even tho i have it on and it doesnt show my camera

#

anyone know the problem

raven spire
raven spire
feral oak
#

Has anyone used the new unity networking?

junior willow
#

For a version 0.1.0 release, the bugs are rather minimal and it's much more sophisticated than UNet

ancient iris
#

And i have photon view is mine

#

But it ain’t workin

ancient iris
#

And from my view the camera follow isn't working

feral oak
ancient iris
#

does anyone know why my players aren't connecting

#

like my players don't go into the same server

#

idk why

#

i create the room and the other person can join it but i dont see the other player

spring crane
#

@ancient iris Double check the region on each client

loud grove
raven spire
weak plinth
#

Hey, I'm looking for a way to set up some data networking without having a hosted server.

The basic idea is, the player fills out some data, in the form of a string. They then press a button that compiles all of this data, and outputs it in another part of the app, that other clients can view.
For example, a leaderboard.

Any methods for this?

I was thinking, picking a random client and run it local host, connecting all other clients to a specific client, and transferring that data to everyone. But IMO that sound's much more complicated, as it won't sync for anyone not on the app, and is a lot of work.

olive vessel
#

Seems like a lot of unnecessary connecting for players, lots of handling dropped connections

rough grotto
weak plinth
#

Haven't tried that method yet, it was just the only thing I can think of

#

mainly looking for suggestions

#

on a way that works good

rough grotto
# junior willow For a version 0.1.0 release, the bugs are rather minimal and it's much more soph...

I have started a new project and was going to do MLAPI since it feels like that is the path to take (my previous was Mirror). But it is far from bugg-free. It is also (very personal opinion here) too low-level and just not feature complete as is. And I am not just talking about the things not implemented, but what is implemented is missing a lot of vital pieces. I am still on the fence, as I am allergic to learning "outdated" tech and want to jump on the MLAPI bandwagon but having second thoughts abou that

rough grotto
#

having a 1 source-of-truth is just so much more convenient

weak plinth
#

What do you think of one specfic local host? For example; a file that when someone from one IP runs it, it sends a signal to every open app, and collects the required data, then sends back everyones data to everyone. The client app searches every few ms for this IP network

rough grotto
#

just use like Firebase realtime database or something similar.
It's not so easy to just "send a signal to every open app", you need some way to reach them

#

or you mean the clients asks the "one specific local host" for data? Then that is as much dedicated host as it gets 🙂

weak plinth
#

Is Firebase free?

rough grotto
#

I don't know the tiers and exact cost. But no it's not *free but probably low cost depending on how much data you want to send

#

amazon aws and azure also has similar products

weak plinth
#

Guess firebase works

#

thanks

rough grotto
#

np, good luck

granite canopy
#

Using Photon Fusion. What's the best way to implement Input System? The APIs use the old input system.
InputPoller.cs

public void OnInput (NetworkRunner runner, NetworkInput input)
{
// old input method:
   if (Input.GetKey(KeyCode.A) { Do stuff}
}

Input System C# Events:

private void HandleAction(InputAction.CallbackContext context)
{
if (context.action.name == "ActionName") { Do stuff}
}

Would it make sense for to variablize every input so:
psuedo code:

private void HandleAction() {
    if (ActionForward) {ActionForward.performed += forward = true;}
}
private void OnInput() {
    if (forward) {inputData.foward |= forward}
    input.Set(inputData);
}
#

inputData is a struct containing unsigned ints.

#

Could I override OnInput to somehow add HandleAction to it?

junior willow
#

I mean no doubt they still got some debugging to do. Hell, they even say you shouldn't use it for production stuff

granite canopy
#

thx

rough grotto
junior willow
#

And wasn't MLAPI going to be a full-on integration with DOTS? I haven't heard anything about DOTS/ECS in a while... I think it's just dead at that point but I'm most likely wrong

rough grotto
#

Think they just call it DOTS-NetCode (so not MLAPI)

junior willow
#

Ah okay

spring crane
junior bronze
#

I'm having an issue when using photon I get this error:"Operation JoinLobby (229) not called because client is not connected or not ready yet, client state: PeerCreated"

spring crane
#

@junior bronze You first need to connect to Photon

#

PhotonNetwork.ConnectUsingSettings() and wait for the OnConnectedToMaster callback

junior bronze
#

I have the connect using settings on the start function

spring crane
#

It doesn't happen instantly, so are you waiting for it to complete?

junior bronze
#

yes so then I can open the tilte menu

spring crane
#

How are you doing the waiting?

junior bronze
#

I'm not sure, I was told It would only call it once it was connected

#

Here is my code

spring crane
#

That looks fine to me

junior bronze
#

i know, but when I run the game it gives the the same error

spring crane
#

Are you sure you aren't calling JoinLobby from elsewhere?

junior bronze
#

the only other code I think that related is

spring crane
#

Yea opening a menu in itself shouldn't be an issue, unless something in the menu is misbehaving

junior bronze
#

I even tried removeing the onjoinedlobby but satill the same error

spring crane
#

What if you remove the JoinLobby call?

junior bronze
#

then the script doesn't do anything after joining the master

spring crane
#

No error either?

junior bronze
#

no

#

I didnt get any errors

#

I think the problem lies whenever I try joining a lobby

rough grotto
stiff ridge
# junior bronze I think the problem lies whenever I try joining a lobby

You don't have to join a lobby. They are optional to organize rooms in groups but even if you want that, you don't have to join.
In general, have a look at ConnectAndJoinRandom.cs and the matchmaking docs.
If you run into issues, enable the SupportLogger and you should get some more context in the logs which state you are in / what happened.

#

It is still telling me that the material data type is not supported
That sounds as if you call photonView.RPC("LoadColor", ... material, ...). The type Material can not be serialized (sent), which is what this error seems to be about. The RPC method definition is ok.

gusty vigil
#

I'm trying to move vr clients using photon and I've got a function to move the different parts in worldspace but it says I can't convert vector3 into quaternion and also the other way around

olive vessel
#

You're setting the rotation to the position, and vice versa?

#

Did you intend on doing that?

gusty vigil
#

oh my god thank you so much for pointing that out

solid wraith
#

Anyone have experience with webGL and PUN?

I'm looking for a friendly network method (API) for a webGL tool I want to make but I have 0 networking experience, but allot of experience with Unity.

grand widget
#

Anyone able to fix some photon stuff for me? (I can pay you) dm me if you are interested

dire condor
#

Hey guys, for Mirror; Whats the correct way to access the port for the transport in the network manager?
Do I need to .GetComponent or is there a field for it in the network manager singleton?

still brook
#

so what's going on with something like atavism. Is claims to be able to handle 10000 CCU based on their website based subscription, but... idk, is stuff like that achievable with unity networking? Is it because they have a non unity back end but use unity front end?

lofty wave
#

How can I keep track of the number of players when Im using MLAPI? Its the same prefab

olive vessel
#

NetworkManager has a Dict of ConnectedClients

weak plinth
#

for some reason when running my multiplayer game using the editor and a build, i get this error in the editor console:

Photon.Pun.DefaultPool.Instantiate (System.String prefabId, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) (at Assets/Photon/PhotonUnityNetworking/Code/PunClasses.cs:997)
Photon.Pun.PhotonNetwork.NetworkInstantiate (Photon.Pun.InstantiateParameters parameters, System.Boolean sceneObject, System.Boolean instantiateEvent) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:2447)
Photon.Pun.PhotonNetwork.Instantiate (System.String prefabName, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, System.Byte group, System.Object[] data) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:2346)
RoomManager.OnSceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode loadSceneMode) (at Assets/Scripts/MultiplayerScripts/RoomManager.cs:39)
UnityEngine.SceneManagement.SceneManager.Internal_SceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode) (at <e2bce5d33e704a76a5c9576f4d43769b>:0)```
and this: 
```DefaultPool failed to load "PhotonPrefabs\PlayerManager" . Make sure it's in a "Resources" folder.
UnityEngine.Debug:LogError(Object)
Photon.Pun.DefaultPool:Instantiate(String, Vector3, Quaternion) (at Assets/Photon/PhotonUnityNetworking/Code/PunClasses.cs:989)
Photon.Pun.PhotonNetwork:NetworkInstantiate(InstantiateParameters, Boolean, Boolean) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:2447)
Photon.Pun.PhotonNetwork:Instantiate(String, Vector3, Quaternion, Byte, Object[]) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:2346)
RoomManager:OnSceneLoaded(Scene, LoadSceneMode) (at Assets/Scripts/MultiplayerScripts/RoomManager.cs:39)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)```
even though my PlayerManager is in the resources folder
#

and its just

#

i hate this

#

lmao

olive vessel
#

You said "resources", is the folder called "Resources"

weak plinth
#

oh wait that wasnt even the issue

#

unity decided to think that scene 1 was not a valid scene

#

so i deleted it from the build and added it back

#

it works now?

#

thats such a weird bug

olive vessel
#

Ah

weak plinth
#

well now theres an even worse bug

#

one player is idle on the local player's screen

reef jetty
#

What is better for tdm game photon pun or mirror?

plush needle
#

PHOTON ISSUES

Does anyone here have any experience with Photon?
For some reason code that used to work just fine, now all of a sudden decides to disconnect a player IMMEDIATELY after creating and joining a room.

It says it's doing so because of "client logic", but there is nothing in the code that is doing this to my knowledge:
https://pastebin.com/xVrTJQbP

Is there any way to drill don on where the issue is?
Because I am quite frankly at a loss and I see not where, why or how existing code that has worked for weeks, all of a sudden should stop working

wooden lantern
#

Any guide for mobile fps multiplayer

#

Any web or assest please help

frosty crystal
#

Hello.

#

I have a question regarding AWS Facebook Integration.
In the begginning of the application,
I want to check if my USER had already signed up before, if so I will redirect him to the "main menu" or not, I will put him through to the sign up menu with other options such as Google, Facebook, Twitter.

#

but do not know how to check?

ancient iris
#

i have a problem, i am trying to get multiplayer game using photon and i need to spawn the players, so i created a prefab for my player but in my script i need to reference my camera so i had to child my cameras to my main player, but then when i child it it's really buggy because it follows my player, btw i use cinemachine, i don't want it to follow it my cinemachine already covers that so idk how to fix.

short sage
#

hey guys, i tried to play my mlapi game over network with a friend and unsurpisingly it didnt work

#

from what ive seen he literally jsut needs the right ip adress to connect to and put that into "connect adress" on the u net transport script

#

but that didnt work out

#

can someone maybe give me some pointer what else i need to pay attention to?

#

i only tested the game via localhost on my own machine and it worked fine there

olive vessel
#

Did you port forward?

short sage
#

negative sir

#

i literally only put in his ip adress

#

and he hosted the game

olive vessel
#

Well then his router is blocking your connection

#

He must port forward, port 7777 is default, UDP protocol

junior willow
#

I'm making a multiplayer game and it's gonna be a long time before it's finished, so would it be a good idea to go ahead and use MLAPI since it's probably going to be more developed when the game is ready for release

short sage
#

so the host needs to port forward

#

and the client "only" connects

#

yes?

olive vessel
#

Yeah the host does it

#

Unless you implement a relay server, or punchthrough

short sage
#

is connect port 7777 fine in that case?

#

or do wen need to select a new one

olive vessel
#

You can use port 7777

short sage
#

so theoretically

olive vessel
#

There's a huge list on wiki, some are used by other programs

short sage
#

the host enables port forwarding for 7777

#

the client connects to the ip

#

deal done

olive vessel
#

Yeah, less theory more actuality

short sage
#

well thatd be amazing

#

thanks for your help dear sir

olive vessel
#

👍

short sage
#

that seemed to not have done it

#

😦

#

is tcp the wrong protocol?

olive vessel
#

Yes, UDP

#

I assume you're using the UNet Transport

short sage
#

unet transport yes

#

still doesnt quite work

#

anything else i need to change in the unet transport script?

#

except the connect adress

#

and connect port to 7777

olive vessel
#

Should work

#

Just for the avoidance of doubt, does the IP begin 192.168.......?

short sage
#

well thats one we took out of the ipconfig

#

his router gave him a new "ip adress on the web" for that port though

#

and we tried it with that one too

olive vessel
#

Any IP beginning 192.168 is an internal IP

#

You used their public IPv4 to connect?

short sage
#

yeah, started with 2.207...

#

i think that was the one ure looking for

olive vessel
#

Yeah I'd reckon so

short sage
#

how do you check ur public ipv4 adress

olive vessel
#

Literally just type "whats my ip" into Google, there's a couple of sites for it

#

I think that's the simplest way

short sage
#

only see hexadecimal ones

#

shouldnt the ip4 adress be 8 bit?

olive vessel
#

Oh they're both IPv6 addresses

#

Tf

short sage
#

most other sites say ip4 adress cant be detected

#

or smth along those lines

olive vessel
#

Maybe your friend has IPv4 disabled on the router

short sage
#

does internet even work without that haha

olive vessel
#

Uh I guess a lot of things would work

short sage
#

yeah he just checked

olive vessel
#

I know IPv6 uptake isn't fast, or totally universal yet though

short sage
#

ipc4 is enabled, and he gave me the right ip adress

#

for some reason i dont see mine though

#

maybe im the problem

olive vessel
#

Maybe so

#

I don't see any other reason it wouldn't work

short sage
#

yeah idk...

#

i dont think i have ipv4 disabled though

#

let me check

#

hm

#

😦

#

i was so hoping it would work lol

#

thanks for your help though! much appreciated

short sage
#

@olive vessel works!

#

i had connection approval still ticked on

#

which wasnt implemented correctly

#

disabling connection approval did the deal

olive vessel
#

Ahh

short sage
#

thank you man, super happy it actually works

#

kinda crazy that i literally created an online game, super cool man

#

thanks

olive vessel
#

👍

glacial veldt
#

i need help with photon

olive vessel
#

If you post a problem, you're more likely to get a response by someone in passing

white wedge
#

Assuming this fits here because im using it for networking:
I am trying to use JsonUtility#fromJson
on a serializable class wtih a list of serializable vectors.
the SVector3's are marked as serializable, but the data array ends up having no items.
the json string, when logged to the console has many items.

Any idea how I can deserialize a array properly?

 [Serializable]
    public class ChunkState
    {
        public SVector3 dimensions;
        public float frequency;
        public SVector2 origin = new SVector2();
        public SVector3[] data = { };
    }
vagrant creek
#

I have no idea

untold wyvern
#

Heya, how do you guys deal with the persistance layer ? I'm currently using PUNv2 and the consensus seems to be playfab.

soft palm
#

Anyone who has some good docs about proper tick synchronisation between the client and server?

cobalt python
#

Hi guys! question about pun: I have an object-spawner that spawns item with PhotonNetwork.Instantiate. But when other player joins he dublicates these objects, what can i do about it? I tryed to add if MasterClient condition:

if (PhotonNetwork.IsMasterClient)
        {
            Transform transform = PhotonNetwork.Instantiate(ItemAssets.Instance.pfItemWorld.name, position, Quaternion.identity, 0).transform;
        }

in this case dublicated objects are not spawned but i have its wired behavior like trembling, slipping away and fast local rotation.

bleak burrow
#

Litelib net

#

Nuff said

still brook
# bleak burrow Litelib net

well thanks, this is something exciting to research. I'm probably like a year+ away from doing anything network related, but knowing there are powerful solutions like that is great.

#

I'd hate to make a wonderful game, and plan for a small group, and then suddenly it gets blown up and I couldn't scale it because of the limitations of my network library lmao

bleak burrow
#

The reason why I recommended the kit is because suriyun improved litelib on his own and made an extention

#

Yup

still brook
#

okay, yeah, if he modified it to make it integrate better, its worth

#

I just like-- you know

#

you see stuff like atavism, for example

bleak burrow
#

Yeah of course

still brook
#

and its like
this is nice, and all
but I just want the network! Lol

bleak burrow
#

He improved it so much the default will have some sync problems over 100 players

#

He gives an example to break up scenes too to improve network

#

And literally gives you a foundation for a mmorpg

#

You don't have to use everything

still brook
#

yeah, sounds good

#

I got it in my favorites so I don't forget

spring crane
#

@brisk briar LAN is for local area network, which in practice is anything that doesn't go over the internet, while multiplayer goes over internet. The implementation in the game is basically the same regardless, apart from not having to deal with network firewalls and a lot of latency.

iron grove
#

Pretty much

#

In LAN you just connect to devices in your local network

#

Otherwise you connect to a server outside of local devices

#

Which likely has been port forwarded to allow connections

icy thorn
#

the only difference is the IP that you connect to in the server

#

WAN ips are usually very different without a concrete pattern

#

as Danny said, you also dont have to deal with latency as much, and its possible to get pings as low as "0 ms" between LAN devices (because there is virtually no distance between devices)

#

on a LAN you just start a server locally, and also start a game client

#

you can then use UDP and broadcasted packets to implement discovery

#

the relevant C# socket option is SocketOptionName.Broadcast

#

under System.Net.Sockets

prisma ingot
#

well i dont know much about network . should i start learning Mlapi or Mirror or code a server .

#

i want to make fps games

#

Anyone?? help

wispy oar
#

Jeez idk. I learn the basics of getting things working in photon, and that a pretty simple one. I just started looking into mlapi and realized idk shit about servers and stuff.

prisma ingot
#

but photon Only have 20 ccu

wispy oar
#

Well only for free. You can have more but it’ll cost you. Any server hosting will cost you. Especially if you don’t have the equipment or know how to run your own servers

gleaming prawn
prisma ingot
#

okky but what if i want more then 20 ppls

icy thorn
#

then pay for more ccus

prisma ingot
#

But im brokrrr

gleaming prawn
#

It really depends if you are planning to create a game to sell, or just a hobby project

icy thorn
#

¯_(ツ)_/¯

#

you cant expect handouts, especially from good, high quality solutions

gleaming prawn
#

for learning, it's all good

icy thorn
#

then 20 ccus is more than enough

gleaming prawn
#

You can experiment with all these solutions

prisma ingot
#

okks

gleaming prawn
#

20ccu is great for testing things out... And with fusion there's built-in punch+relay, so players host the game etc

#

No need to run a server

#

And you said FPS

#

For that you need client side prediction, lag compensation, etc

#

There are only two netcode SDKs with those built-in, and both are from us (photon)

prisma ingot
#

but mirror is grt as well isnt it?

gleaming prawn
#

Bolt and Fusion (which is the new tech that is replacing both bolt and pun, so no reason to use any of the legacy solutions if you are just learning)

gleaming prawn
prisma ingot
#

oh oky

gleaming prawn
#

mirror is free open source.

#

and has a good community around

#

for an FPS you absolutely need a tick-based netcode with client side prediction + lag compensation. Mirror/Mlapi has none of these

#

these things above is what every single competitive shooter uses... without these it's just a sloppy attempt

prisma ingot
#

oh oky tnxs for the help

gleaming prawn
#

So you either develop them yourself (which is also a possibility)

prisma ingot
gleaming prawn
#

or take a solution that includes them out of the box

prisma ingot
#

u mean dis?

icy thorn
#

what you use depends on how much you want to learn

prisma ingot
#

i want to learn then earn

icy thorn
#

as Erick is saying, you can either learn about how to make a game (and use Photon), or you can learn how to make a networking solution (and DIY it)

gleaming prawn
#

exactly

icy thorn
#

i would suggest going Photon

#

then, if you want to learn more later, just try to implement the netcode yourself

#

once you have a game that becomes easier, because you know what you need

#

if you are doing it DIY from the start the end goal is much more nebulous and harder to "reach" in any meaningful sense

prisma ingot
#

what is netcode ....

icy thorn
#

netcode is just how clients and servers interact

#

basically, the networking aspect of a game

prisma ingot
#

oh

icy thorn
#

it also includes rollback, lag compensation, other stuff

#

its a generic term

prisma ingot
#

so i should start photon ?

icy thorn
#

if thats what you want to do

#

we cant decide for you

prisma ingot
#

But i want u guys to decide cause im just starting

gleaming prawn
#

do you want to make games or becomes an engine developer?

#

do you like to implement A) gameplay, or B) do you like to write code/APIs for others to use?

#

if answer is A/games/gameplay, go for existing libraries...

#

I don't create games, I create libraries/engines for others to use... These are totally different things

prisma ingot
#

i just got ur tutorial Hello Fusion FPS - Part 1 (client prediction, server reconciliation, lag compensation)

gleaming prawn
#

ye, that shows a couple of things you really need on an FPS

#

there's also a longer series on my twitch

prisma ingot
#

can u give me the link

gleaming prawn
prisma ingot
#

its about photon right??

icy thorn
#

unavailable?

gleaming prawn
#

Yes and no

icy thorn
#

😦

gleaming prawn
#

wrong link, fixed

icy thorn
#

🙂

gleaming prawn
#

I use photon fusion in the last series, but I discuss the topics in general terms

#

You could technically write your own stuff based on the discussion

prisma ingot
#

so should i start from that?

gleaming prawn
#

no

#

that's a bit advanced

#

you should start coding a simpler game

#

If you've never done a game before, start with something single player even

prisma ingot
#

yeah made one hehe

gleaming prawn
#

If yu've finished games before, then fine, go for MP, but write something very simple first

icy thorn
#

multiplayer pong incoming

gleaming prawn
#

nah

#

I don't like that as an example

#

🙂

#

Honestly, pong is technically NOT easy (if you want to make it correctly)

#

You need full predict rollback for it to look right

#

Just write something where players move around, collect some stuff, drop them, etc

#

Something slow paced, etc...

prisma ingot
#

ok and if in future i want more then 20 ccu

#

buy ??

#

or move to other softwares

gleaming prawn
#

To have 100ccu, i normally means you have 2k DAU, 40k downloads/copies-sold or so

#

So it again boils down to what do you what to do with these games.

prisma ingot
#

Sell them

gleaming prawn
#

So if you ever get to high CCUs it means you have a lot of people playing (and hopefully paying) your games

#

It's never been a problem for studios working with us

prisma ingot
#

alright im starting

untold wyvern
#

@gleaming prawn Hi Erick, I was wondering what's the go-to solution that photon users implement for persistance and account information, ie login, items, coins and whatnot.
Thanks!

gleaming prawn
#

I see many customers use Playfab

#

The other common solution is custom/proprietary backends (many studios and publishers have these, as they use across multiple games, etc)

untold wyvern
gleaming prawn
#

(edit: I don't have exact numbers about which is most common of the two above, so won`t state that detail)

untold wyvern
#

Playfab is good enough for my one man team lol

#

Thanks for the answer!

frosty crystal
#

Hello.

#

I have been looking through the internet and could not found anything. Thank you in advance again!
My AWS IAM user can delete or update a slot in the dynamoDB only if they enter one time password.

#

I could not found how to do that.

#

you have any idea? thanks

untold wyvern
#

A few more questions for the road.
What's the default tick rate w/ PUNv2 and is there a way to change it?
Also considering that bolt doesn't provide host migration, I suppose using playfab for that would work out right?

And last question, I just looked at fusion and it seems a lot better than PUNv2, seeing as i haven't made a ton of progress network wise, switching to fusion would be a good idea right ?

wanton zinc
#

Hey guys, what does this setting actually do? (internet acces)

#

btw even if i set this to require and i turn off wifi on the android device the app starts anyway. Is there a way to prevent the app from starting if no internet connection is present?

gleaming prawn
#

I suggest you check Fusion, which is replacing both Bolt and PUN

#

And Fusion WILL have built-in host migration.

#

Implementing host migration yourself is a MAJOR task, it's not as simple as "I suppose using playfab for that would work out right? "

untold wyvern
gleaming prawn
#

We can't share hard ETAs

untold wyvern
#

But I might as well get started with fusion

#

I can make do with a very soft one

gleaming prawn
#

BUt it is a 1st class feature that will be in for when move from beta to relase candidate

#

notice Bolt and PUN are very different in feature-set

untold wyvern
#

Alright that was very soft indeed lol

gleaming prawn
#

Fusion is a super-set of both

untold wyvern
#

Yes that's what I noticed

#

It's a perfect candidate for what I'm working on

gleaming prawn
#

and the two legacy products are to be maintained in LTS mode (bug fixes only) for the long run

#

No new features anymore (for bolt and PUN)

#

They won't stop working (as we have lots of customers using them in production games), but won't receive major updates

untold wyvern
#

Gotcha

spring crane
#

WebGL support when

untold wyvern
#

Will fusion also provide a persistance layer or something like playfab would still be needed ?

gleaming prawn
# spring crane WebGL support when

for fusion and quantum, no idea... When WebGL builds offer proper fast mem operations... We're re-evaluating that in the next couple of weeks

gleaming prawn
untold wyvern
plush flint
#

I have 2 NetworkTransform (MLAPI) components, one on parent object (synchronize position) and one on child object (synchronize GFX object rotation). When I join as a client the parent object's position is synchronized with all other clients but child object's rotation is not synchronized (all clients have quaternion identity rotation) at start, first I need to adjust this rotation (based on player's camera rotation) so that the rotation will be sychnronized with all other clients. Does anyone know why is this happening?

plush flint
#

Well I found out that parent object with networktransform is synchronized with clients when they join but child object with networktransform is not (all other clients have default values when new client joins), it will synchronize only after the value has been changed. Dont know if I'm missing something but this behavior is kind of strange to me

lime pier
#

Hello, would it be smart to use a Netty Java server for a multiplayer game? 😅

gleaming prawn
#

honestly, it would be a lot of work to write gameplay code twice in two different languages and tech stacks

#

There may be use cases for this, but it's not the easiest of the options, and there is no clear advantage either...

gleaming prawn
#

it really depends a lot what kind of game you are trying to write

#

And how much experience you have

lime pier
#

I wanted to start with a small 2D game

gleaming prawn
#

that does not say much

#

is it a turn based card game? an action game? a fighting game (difficult)?

lime pier
#

A fighting game.

gleaming prawn
#

that's not the easiest ting to start with

#

You have two professional-grade options:

  • use GGPO. together with a lot of custom code for hitbox detection, something to use as transport layer (could be steam etc)
  • use photon quantum, which is a predict-rollback deterministic engine
#

Fighting games are notoriously difficult to network

weak plinth
#

Hi, where to ask questions about setting up a multiplayer game?

lime pier
gleaming prawn
#

as long as the PvP interactions are not super complex, for that you can use basically any of the existing options... With different degrees of sync accuracy, etc

#

mirror, mlapi, pun, photon fusion, etc... whatever you feel more comfortable with

lime pier
#

Okay I will have a look at the things, thank you.

weak plinth
#

What about checkers game? I have one from unity assets, which unfortunately doesn't support 2 player game with 2 devices

signal crown
#

Is anyone knowledgeable on Photon? I'm copping an error Illegal view ID:0 method: OnPlayerSpawnedRPC GO:Player and I'm not having much luck finding a solution to it.
I have 2 codes, this one works:

public void SpawnPlayer()
    {
        float PlayerXPos = -6.26f;
        float PlayerYPos = 5.542f;
        float PlayerZPos = 27.07f;
        PhotonNetwork.Instantiate(TestPlayer.name, new Vector3(this.transform.position.x, transform.position.y, transform.position.z), Quaternion.identity, 0);

        GameCanvas.SetActive(false);
    }```
Whereas this one throws the error
```cs
public void SpawnPlayer()
    {
        int index = -1;
        for(int i = 0; i< availableHouses.Length; i++)
        {
            if (assignedHouses.ContainsValue(i))
            {
                continue;
            }
            assignedHouses[photonView.OwnerActorNr] = i;
            index = i;
            break;
        }
        if(index < 0)
        {
            return;
        }
        Vector3 spawnPos = availableHouses[index].SpawnPosition;
        GameObject photonPlayer = PhotonNetwork.Instantiate(TestPlayer.name, spawnPos, Quaternion.identity, 0);
        GameCanvas.SetActive(false);
        photonView.RPC(nameof(OnPlayerSpawnedRPC), RpcTarget.OthersBuffered, index);
    }```
weak plinth
#

Where to ask for help?

olive vessel
#

Depends on the question

#

This is for questions related to networking in Unity

#

(The TCP/UDP kind, not the making friends kind)

weak plinth
#

Ok, I get it, my issue is modifying a single player game into 2 player game. What do I need, is it enough to setup MLAPI?

olive vessel
#

Well it's a bit more than just importing MLAPI

#

DapperDino has a few videos about MLAPI

weak plinth
#

Thanks I will watch him

untold wyvern
#

Your best bet is dapperDino

weak plinth
#

thanks again

olive vessel
#

MLAPI is relatively new, I would guess there are more tutorials for the older Mirror networking solution

weak plinth
#

Full of Dino's videos

cobalt python
#

Hi! question about PUN. When a new player joins, can i get reference to a gameobject he controlls?

weak plinth
#

wha?

#

can you elaborate please?

cobalt python
#

sorry, i mean when a new player joins the room a player prefab is instantiated. Can i have a reference to it?

weak plinth
#

you dont need to reference it, thanks to the glory that is photon.

#

what you need to do

#

is this simple line:

#

PhotonNetwork.Instantiate(Path.Combine("PhotonPrefabs", "YourPlayerPrefabName"), desiredPosition, desiredRotation)

#

make sure you have using System.Linq at the top of your script

#

and create a folder in your unity assets folder called "Resources"

#

exactly how i wrote it above without the quote marks here ^

#

and in the Resources folder make another folder called "PhotonPrefabs"

#

again, exactly how i wrote it above without the quote marks here ^

cobalt python
#

so u described how ti instantiate a prefab? I mean a little different thing:
i want to calculate distance to player that has joined the room. So i need a reference to a Player gameobject that has just joined.

ancient cypress
#

anybody has a hint for me how to play live-video-streams in WebGL? I found video-plugins in Asset Store like Universal Media Player (UMP) that can run live-streams (RTMP / HLS) but only in Windows-Version. I wanted to show live-webcasts in WebGL version too

opal tundra
cosmic vector
#

Hey all, I’m wondering if anyone might be able to point me in the right direction for something. My current project requires me to listen for an incoming web request in unity in order to receive an authorisation token from Spotify. The system works fine when targeting windows/Mac but when targeting webgl it hangs without an error. This is because the current solution uses a small web server on a thread, which isn’t supported for webgl.

#

Is there any non threaded approach I could take to listen for the callback response coming back from Spotify?

frosty crystal
#

Hello.

#

My question is so short.

#

Is it possible to use AWS (DynamoDB, S3 and other services) in Unity Editor?

#

My unity tool is going to make some CRUD operations.

#

Thank you in advance!

compact wigeon
#

Hi, so I want to make a multiplayer 2d game with weapons and stuff like that, I added some simple player movement, when should I start add Photon to my game?

haughty heart
#

From before you did simple player movement.

#

So, the sooner the better.

compact wigeon
#

Oh alright

#

So I was thinking right

#

Cause I might need to rewrite most of the scripts for multiplayer, right?

haughty heart
#

At least integrate it with Photon.

compact wigeon
#

Is it hard to add inventory system to a multiplayer game?

haughty heart
#

It's hard to add anyhting to multiplayer.

compact wigeon
#

Oh

#

Even basic movement?

haughty heart
#

It's a lot of work to sync content.

compact wigeon
#

Eh, I will take my time

#

I have one more question

#

If I want to make a matchmaking system, meaning in my game, there will be n numbers of matches at a time, do I need to make some more things besides writing the matchmaking script?

#

For short: if there are more rooms, do I need to sync more stuff?

haughty heart
#

Yes

compact wigeon
#

What exactly?

haughty heart
#

Well, the rooms for one thing. Who's in them, number of players, passwords ,etc.

#

Just play an online game and see what information is being shown.

compact wigeon
#

I hope there is enough documentation

worn spire
#

In fact all the information you need to maintain the game, the info about the player, anything that is needed to be known.

#

Multiplayer is a pain, and as Osteel said, integrate it as early as possible, the more you wait, the more you will need to rewrite

compact wigeon
#

Oh

#

Damn

#

Even my movement script?

worn spire
#

the data needed to move for sure... since all client and the server if applicable need to be aware of the position of each player

compact wigeon
#

Ah

#

Do you know where can I learn photon?

worn spire
#

nope sorry... by trial and error I suppose, it's how I learn everything

compact wigeon
#

Oh

worn spire
#

start by their website

#

and the documentation section/SDK will certainly cover the information you need

#

Their documentation section seem to be well structure with everything you need to start

compact wigeon
#

Thanks

#

Photon offers 100 players at the same time for free right?

worn spire
#

I don't know...

compact wigeon
#

It says 100ccu or something like that

worn spire
#

then yes, you have 100 concurrent users

compact wigeon
#

Oh nice

tawny mural
#

Any really good tutorials for how to a 2d multiplayer games?
Please @ me

alpine badger
#

Hey Does anyone know how to make a killfeed with photon pun?

frosty crystal
#

Hello.

#

In AWS can I reach the AWS servers in compiletime (UNITY EDITOR) not RUNTIME.

prisma ingot
#

Why is OnJoinedRooms() not working

#

anyone??

#

Help

stiff ridge
prisma ingot
#

........

#

ok tnx

#

Still not working

#

It doesnt also autocomplete

stiff ridge
#

Look carefully. Your code looks like in the first shot...?

prisma ingot
#

wdym

stiff ridge
#

The screenshots are identical. Ofc the second won't work better...

prisma ingot
#

Just tell me what to do

stiff ridge
#

Fix the method name. It must be OnJoinedRoom()
Also, your class inherits from MonoBehaviour, which does not define OnJoinedRoom(). Inherit from MonoBehaviourPunCallbacks.

prisma ingot
#

oh oh i see Thx man

dire ridge
#

How to fix this error?

viscid drum
#

Set the request headers (content type, user agent etc) and try sending it that way

viscid drum
#
UnityWebRequest www = new UnityWebRequest(url, UnityWebRequest.kHttpVerbPOST);
byte[] body = new System.Text.UTF8Encoding().GetBytes(json_string);
www.uploadHandler = (UploadHandler)new UploadHandlerRaw(body);
www.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
www.SetRequestHeader("Content-Type", "application/json");
www.SetRequestHeader("User-Agent", "DefaultBrowser");
www.SetRequestHeader("Cookie", string.Format("DummyCookie"));
www.chunkedTransfer = false;
yield return www.Send();
#

Copy Pasta code, might not work 1:1

viscid drum
#

Google -> Unity WebRequest set header

scarlet token
#

how to remove Development Build text on bottom right? I am using Photon PUN 2 Free

spring crane
#

Untick development build in build settings

compact wigeon
#

Why is photon lying about their prices

#

Here it says that 100CCU is free

#

When I made an app, it says it costs 100 dollars

tawny mural
#

Is there a goog tutorial for making a 2d multiplayer game from scratch?

gleaming prawn
#

The screenshot you attached is for self-hosted photon server (you can even read "Photon Server Pri..." in the header). 100ccu free is correct.

#

when you create App IDs on our dashboard, you are talking about photon realtime or PUN running on our cloud (which have a page for their pricing). This "pink" page is the one about photon server

#

For cloud-based pun/realtime, 20ccu is free

lament egret
#

Anybody here use NetCode? There's part of the architecture I am having trouble understanding...

gloomy sand
#

Not sure if this is the right channel.
What’s the recommended library for creating / signing JWTs token in Unity?
This is for a headless unity server that needs to communicate with the backend

#

The one on github, JWT-For-Unity hasnt been updated in years, and Mono did not support elliptic curve crypto methods last time I tried to use microsoft DLLs

scarlet token
#

Apparently my friends cant play my multiplayer game with me because im in a different country. i am using Photon PUN 2 free, why is this happening? i want to make the multiplayer global so peoples can play with peoples in different country

spring crane
#

People from different countries can play together, but by default Photon connects to a region closest to the user

#

At some point the latency will become pretty painful, especially if you are doing something over masterclient

keen mirage
#

anyone have any idea where to find this build.gradle? Im trying to setup Firebase for my push notification. I skip this part but then when i tried sending message to device its not receiving it.

karmic solstice
#

you could just copy and paste the text box in, (sorry, I'm not that well educated about firebase)

keen mirage
#

yeah but i cant find this build.gradle in my project

karmic solstice
#

Does anyone know if the new unity networking supports clients joining multiple servers simultaneously?

prisma ingot
#

hOW TO SOLVE DIS ERROR

#

i can only create rooms and cant join them

#

(Its photon pun 2)

gleaming prawn
#

read the message, and set a region in the proper slot, not in the on that says dev

#

That's what I take by reading the message

stiff ridge
stiff ridge
#

I'd recommend the PUN Basics Tutorial, too. That should help you get over the teething problems. Read and code-along.

keen mirage
#

where to put this code in my xcode? Im not really sure where AppDelegate class is.

scarlet token
spring crane
#

At least you could force the region to be the same. You might also be able to combine regions together in a way that allows everyone to play with anyone on the network, but no idea if you actually can.

#

Combining would probably be ideal as going through Photon's infra might be faster than letting ISPs decide the route

scarlet token
#

okay, so i need to set the fixed region or the best region in the PhotonServerSettings?

spring crane
#

Fixed

scarlet token
#

okay

#

i might also try to the combining one

carmine stag
#

any networking suggestions?

carmine stag
#

i know about those i see people use them but i want other suggestions before I decided

#

i cant spel;

uncut comet
#
using Photon.Pun;
using System.Collections.Generic;

public class FirstPersonMovement : MonoBehaviour
{
    PhotonView view;

    public float speed = 5;
    Vector2 velocity;

    [Header("Running")]
    public bool canRun = true;
    public bool IsRunning { get; private set; }
    public float runSpeed = 9;
    public KeyCode runningKey = KeyCode.LeftShift;
    /// <summary> Functions to override movement speed. Will use the last added override. </summary>
    public List<System.Func<float>> speedOverrides = new List<System.Func<float>>();

    

    private void Start()
    {
        view = GetComponent<PhotonView>();
    }


    void FixedUpdate()
    {
        if (view.IsMine)
        {
            // Move.
            IsRunning = canRun && Input.GetKey(runningKey);
            float movingSpeed = IsRunning ? runSpeed : speed;
            if (speedOverrides.Count > 0)
                movingSpeed = speedOverrides[speedOverrides.Count - 1]();
            velocity.y = Input.GetAxis("Vertical") * movingSpeed * Time.deltaTime;
            velocity.x = Input.GetAxis("Horizontal") * movingSpeed * Time.deltaTime;
            transform.Translate(velocity.x, 0, velocity.y);
        }


    }

what is wrong with my code?

#

when I go to Multiplayer, in Unity I go two players but I control them both and in the build I only see one player

coral belfry
#

The base design of PUN/PUN 2 is around a decade old, and fusion is pretty new

#

it's better optimized, will have longer support, and is a much better solution tbh

spring merlin
#

hello guys I am trying to use Photons OnPhotonSerializeView funcion to send a gameobject variable but cannot figure it out, any suggestions?

stiff ridge
#

And yes, it might make sense to get into Fusion right away, if you are just starting out with networking and PUN specifically.

rich frost
#

Im using normcore for learning some basics about multiplayer games in vr

normcore has already a voice-chat setted up, but is spatializing, so if someone talk is 3D Sounded.
What I want to know if there's any possible way how to eliminate the 3D Sound only for Voice-Chat

silent zinc
#

There should be an option to set audio output to stereo mode only.

ebon vortex
#

I have this script for a player, https://pastebin.com/bExCYdJw . When I spawn in players, they paint on the screen as expected. However, when I move a character, it only moves on the client (i.e not reflected to others). What could be the cause of that? I am using Mirror as my networking api

#

This is the player prefab

weak plinth
#

hello guys, I'm using google mob ads and tried test ads and it work, should I upload my game on playstore in order to show the real ads

#

because the real ads won't show after build

glass rain
#

is there any good source to learn networking from?
and easy to read and understand

runic panther
#

I use MLAPI btw

#

i slowed it down to see if the issue is because of the speed of the player but it doesn't seem like it since i kind of still glitch through the other player

glass rain
#

maybe collisions?

runic panther
#

they both has box colliders

#

i have a theory that its because i the velocity is being set to a number so the network cant keep up with it ?

#

also i think that because when i jump on the other player i can collide

#

so maybe its something with the movement script

#

i use rb.velocity to move btw

runic panther
#

anyone has an idea ? im close to giving up lol

misty totem
#

Have you tried it with using force to move rather than velocity?

ebon vortex
#

I am moving my objects using this:

    private void moveCharacter(Vector2 direction) {
        rigidBody2D.MovePosition(rigidBody2D.position + direction * Time.deltaTime * speed);
    } ```
However, it is very laggy when coming from a client, ref this video https://www.youtube.com/watch?v=LAUVcgRBrBQ . Char # 1 is server, char 2 is connected client. What am I doing wrong ?
runic panther
runic panther
carmine stag
#

can someone tell me how i can use sockets and how it works like is it code or a website

olive vessel
#

C# Sockets?

carmine stag
#

i mean yea whatever it runs on

olive vessel
#

I have no clue what you mean?

carmine stag
#

like tell me how stockets work

lusty pelican
#

@carmine stag if you don't even know what sockets are.. you're not going to be able to use them

olive vessel
carmine stag
#

i looked that up

lusty pelican
#

start by researching what a socket is before assuming it's the solution to whatever problem you're trying to solve

carmine stag
#

i did look it u[

#

up*

olive vessel
#

If you want multiplayer, there are higher level solutions than sockets you know

carmine stag
#

i know but someone said to look into sockets and mirror

lusty pelican
#

+1 to that, highly suggest looking for a higher-level solution or even just a general introduction to network programming in Unity

olive vessel
#

What do sockets have to do with Mirror

#

Granted it uses them, but I doubt you'd see them

lusty pelican
#

^ technically Mirror uses sockets, yea

olive vessel
#

The point of Mirror is so you don't have to do it yourself

lusty pelican
#

but not at all in actual code you'd be writing

carmine stag
#

wait so they are kinda the same?

lusty pelican
#

not at all

#

mirror is a C# library

carmine stag
#

this is my first time making a mutiplayer game

lusty pelican
#

sockets are a fundamental part of computer networking

carmine stag
#

oh

olive vessel
#

Mirror is really good, lots of different transports to get what you want

lusty pelican
#

Instead of the typical "don't try it" response I'll suggest going over some multiplayer networking tutorials. There's lots of good resources on the subject on youtube

carmine stag
#

imma keep looking into sockets cuz i alr looked up Mirror Thank you for the help

olive vessel
#

"first time making a multiplayer game" "imma keep looking into sockets"

lusty pelican
#

.... look man no one is going to hand you a multiplayer game for free, you're gonna have to read further into it than that

#

regardless of whether you've already looked up tutorials, if you're still asking questions like these you haven't absorbed enough information from those tutorials

#

not trying to be rude of course, I just want you to understand the reality of it

#

hopefully that helps

carmine stag
#

i am looking into like 5 videos right now

#

they just talk about how networking works

ebon vortex
#

Any ideas to why my game is lagging for clients? 🙂 I am pretty sure I have misunderstood the concept of [Command] .. but I'd just like some verification 🙂

frosty crystal
#

Hello. in AWS
Users in my app should be authenticated by Facebook and google. But if I use "Identity Pool" how can I save their profile data in cognito?
Should I use "User pool"
Or is it a good practice to save user data via Cognito Sync.

carmine stag
ebon vortex
#

@carmine stag the one character is lagging quite a lot compared to the other one (it's significantly slower). But I actually just fixed it. I was wrong to use a command for the move. This is automatically synced. I simply had to set my players as authoritative, and it works! 🙂

carmine stag
#

oh ok

frosty crystal
#

Hello. After my users authenticate with facebook and federated identity pool in AWS, how can I save user data as a new user in database?

#

should I choose Cognito sync

lusty pelican
#

Hey guys, is anyone interested in a subscription-based service that works with Unity that offers User Accounts and Saving Data? Basically PlayerPrefs but in the cloud

lusty pelican
#

There would be pricing tiers, but it would be as cheap as possible taking into consideration storage and data transfer costs

runic panther
spring crane
#

Are you using transform syncing? Setting the transform position isn't good for physics behaviour.

weak plinth
#

Anybody know how to implement peer-peer networking into Unity? Can't find any documentation really for it

spring crane
#

My guess is that you push the remote player and then the transform sync kicks in and teleports the remote player behind you

runic panther
#

and i have to have that to see other players move around

spring crane
#

Sure, but you are facing some of the issues with this sort of naive transform syncing

runic panther
#

that can work with the mlapi?

#

or can anything work with it?

spring crane
#

Just like most basic networking solutions, I doubt they have a solution for this built-in. There obviously are ways around it as seen in other multiplayer games where collisions are important.

runic panther
#

but just running into them is the issue

spring crane
#

Yea since the transform sync is effectively doing nothing in that scenario

runic panther
#

got it

#

so its the NetworkTransform

#

correct?

#

just like u said

spring crane
#

Yes

runic panther
#

ok do i just scrap using that package?

#

or do i just find another way to sync movement between the 2 players?

spring crane
#

That's something to decide once you have found a more proper way to do this

olive vessel
#

Mirror, MLAPI

#

Both do P2P

weak plinth
#

They'll work easy enough in Unity?

ebon vortex
#

Speaking of mirror .. I have working networking now, but it seems physics isn't synced with the server. If I run with my character on one client and clash into another character, the other character will get pushed away, but this movement isn't reflected.. anything in particular I need to look at?

olive vessel
#

They are designed for Unity?

#

Unity took over MLAPI

#

Mirror is UNet but alive and better

ebon vortex
ebon vortex
#

Anybody ? 🙂

lyric osprey
#

When working with audio in multiplayer, is there an efficient method of changing the sound clip being played for all clients?

ebon vortex
#

@lyric osprey I have very little experience with both unity and networking .. but I would think you could use a clientcommand and trigger a new clip? Maybe set a [SyncVar] (if you're using mirror) and change it via that ?

lyric osprey
#

huh, guess that works

#

can you syncvar audio clips?

ebon vortex
#

No clue 🙂 I am making a wild guess/suggestion 😛

#

Maybe you can syncvar an identifier and change it in your update code ?

#

Disclaimer: My sincere apology if I am completely missing the target or giving bad advice here. I must emphasise that I really don't know what I am doing here.

verbal lodge
#

Yeah usually you try to map things like audio clips to ids and then you just sync the ids with a syncvar.

ebon vortex
#

Any suggestions on how I can get my physics calculated on the server and returned to the clients? Is this, https://wirewhiz.com/unity-multiplayer-using-mirror/ , an appropriate approach in 2021 in a 2d setting ?

lime ermine
trail lark
#

json deserialization is not working on android, any suggestions?
I need help with this.

#

Sorry for interrupting too

#

Newtonsoft.Json is not working either

#

Works fine on editor/ios

lusty glade
#

Question, what could possibly cause unitywebrequest to throw "unknown error"?
It works fine in editor, but it throws error on android device

        request.useHttpContinue = false;
        request.SendWebRequest();
        while(request.isDone == false)
        {
            yield return null;
        }
        Debug.Log("Sending Request Complete");
        Debug.Log(request.downloadHandler.text);
        loadingIndicator.SetActive(false);

        if(request.isNetworkError)
        {
            RetryAction = retryAction;
            errorText.text = request.error;
            errorPopUp.gameObject.SetActive(true);
        }else
            if(callback != null)
                callback.Invoke(request.downloadHandler.text);```
trail lark
#

You may be handling the network errors wrong

#

I solved that by using a dictionary to parse the result and making a check for "error"

lusty glade
#

No, the request.error itself is throwing "Unknown Error"

trail lark
#

do you get the Debug.Log(request.downloadHandler.text); ?

lusty glade
#

I've read some google result and advice to switch to internal build, but I'm using unity 2019 so the option is not available anymore

lusty glade
trail lark
#

if it's a network error your result should have a json starting with "error" element, isNetworkError checks the result for a similiar input

#

It doesn't check the class itself, or whether the result comes back or not for instance

lusty glade
#

I got
07-10 19:01:32.754 13080 13103 E Unity : Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED
server side problem?

trail lark
#

or that's just isError, but I remember it that way

#

Haven't used Minijson tbh, could be part of that

#

but if you do not get the debug.log before that

#

it could be that throwing the error so you don't see the rest of it

lusty glade
trail lark
#

but do you see the Debug.Log(request.downloadHandler.text); line's result on your log?

#

or does that error you shared is all that you get?

trail lark
#

you might be missing a token for instance, cert (certification)

lusty glade
#

Yep, here's the full log (except for the unity start up log)

07-10 19:01:31.592 13080 13094 I Unity   :
07-10 19:01:31.592 13080 13094 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
07-10 19:01:31.592 13080 13094 I Unity   :
07-10 19:01:32.754 13080 13103 E Unity   : Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED
07-10 19:01:32.754 13080 13103 E Unity   :
07-10 19:01:32.754 13080 13103 E Unity   :
07-10 19:01:32.754 13080 13103 E Unity   : (Filename: ./Modules/UnityWebRequest/Implementations/TransportCurl.cpp Line: 734)
07-10 19:01:32.754 13080 13103 E Unity   :
07-10 19:01:32.769 13080 13094 I Unity   : Sending Request Complete
07-10 19:01:32.769 13080 13094 I Unity   :
07-10 19:01:32.769 13080 13094 I Unity   : (Filename: ./Runtime/Export/Debug/Deb
ug.bindings.h Line: 35)
07-10 19:01:32.769 13080 13094 I Unity   :
07-10 19:01:32.772 13080 13094 I Unity   :
07-10 19:01:32.772 13080 13094 I Unity   :
07-10 19:01:32.772 13080 13094 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
07-10 19:01:32.772 13080 13094 I Unity   :```
lusty glade
lyric osprey
#

i have a library where i can specify that a sound happened at a specific place, and then it's called on enemies around it

trail lark
#

make sure it's before your webrequest

#

if you don't see it, somehow your minijson is not working, otherwise you can try to set some headers for authentication

#

but when headers are missing you get actual response with error

#

so it's not what you have.

spring crane
trail lark
#

I've followed a few answers from the web (I'm pretty sure from answers.unity) and installed the working one (and not the latest from official)

#

and not the one on Visual Studio

#

it works on the editor, ios too

#

and it worked on a separate dummy project

#

which I builded for android

#

it's silly, somehow I get a nullreference exception on deserialization of the same object

#

it's a bit large in size too, so I can't remove and try with and without all plugins

lime ermine
compact wigeon
#

Hi! So Im using photon and in editor it does not let me create or join rooms but in builds it works. Why is that?

quaint wraith
#

Hello! I'm making a game with vastly different gameplay for each client (1v1). One is basically at a desk in a 3d environment and can't move, while the other moves around on a 2d map.

How should I go about implementing this ? I can easily spawn clients with the same object essentially, but how do I make one have a completely different view & system than the other ?

I am using MLAPI btw.
Thanks!

spring crane
#

Have you tried looking into documentation to see how you can replace the logic for spawning those prefabs?

quaint wraith
#

pepedetect I couldn't find it but did now, thanks.

#

Oh.. yeah ok I'm just being 3am dumb here KEKW

lime ermine
lyric osprey
#

Pain

#

wish you could just send the audioclip through the net message

lusty glade
dapper night
#

Hello everyone,
I have questions about multiplayer networking. I have already done days of research on Google (now everything is purple XD so now i feel like im stuck)

  1. how do clients / server synchronize abilities ? (like a spell cast in League of legends)
  • From what I got from a few GDCs, the local client predicts it's abilities with player inputs, but how does he predict others abilities.
  1. how to synchronize Clients / Server shooting projectiles.
  • is a shooting event is sent for every bullet, or the server just says player X shoots and the client predicts the rest. but what if the client wrongly predicts a rocket or something really noticeable.
    Thanks
lyric osprey
#

Regarding sending messages from client to server and vice versa, does it NEED to be in a network behaviour?

#

I plan on making something instantiate an empty gameobject with an audiosource that plays at that location to make it easier to play sounds

dense hedge
# dapper night Hello everyone, I have questions about multiplayer networking. I have already d...

Basically, the server and all the clients run the same gameplay logic. Clients run ahead of the server—they simulate each timestep (tick) before the server does—and send their inputs to the server. The "running ahead" is called prediction and it's done because those input packets take time to reach the server.
Anyway, with the inputs it receives, the server sims the true, authoritative version of every simulation step. Then the server sends a copy of the true game state (commonly called a snapshot) back to the clients. Again, the clients are predicting the future state of the world. The snapshots are in the past. So whenever a client receives a snapshot, they first have to rewind their simulation back to that step (now with the authoritative data), re-simulate however many steps to catch back up, and then predict the next step.

#

So 1) Clients predict their own actions by just processing your inputs and running the simulation ahead of the server. To extrapolate other players somewhat accurately, the server would have to send you their inputs. Doing that is rare though. (Rocket League does). Most games just interpolate the other players between those snapshots and have the server break causality (lag compensate) so you don't have to lead shots and stuff.

#
  1. Mispredicts basically amount to visual glitches. They won't affect the server's simulation (the server doesn't predict, so it can't be wrong), so you seeing the rocket spawn but then vanish because you actually got stunned, while annoying, is just an artifact.
#

^ That's all basically how your "standard" server authoritative multiplayer works.

#

The worse your ping to the server is, the further ahead of the server your client has to be to deliver its inputs on time, and the more likely you'll see mispredictions.

dapper night
#

thank you very much @ Joy # 1194
from your first message i see you mentioned (ticks), i've probably seen it on every GDC i've watched but i don't know why i still don't get it 100%.

dense hedge
#

Tick is just another word for simulation step or timestep.

dapper night
#

how does server and clients use it and ho they syc it

#

like how the server sync it with clients and when clients use it ?

dense hedge
#

Like it means you're simulating the game in discrete steps. Clients need to receive one snapshot from the server before they can start simulating.
But once they start, they need to simulate each step ahead of the server (tick 100 refers to the same in-game moment for everyone), by enough time so that the input packet doesn't arrive late.

#

I don't recommend using RTT/ping measurements to regulate that, but basically clients need to simulate ticks RTT/2 ahead of the server does, more if the network is unstable.

dapper night
#

im already using the RTT/2 to push server snapshots more to the present and im also sending players inputs so all clients are simulating are fully ahead of the server.

dense hedge
#

Rather than do any kind of time offsetting, the strategy suggested in the Overwatch GDC talk is to have clients simulate at a faster/slower rate to converge on the appropriate lead.

dapper night
dense hedge
#

Like if the server is 60 ticks per second and my client is behind where I need to be, I'll do say 62 ticks per second temporarily to get further ahead.

dense hedge
#

Like at some point, somebody is gonna need to reconcile a lot of ticks, and you can't know when. So it's better for you to know that your client can always handle it.
The only benefit I can see to reconciling just when needed is that it might save a bit of power on mobile devices.

dapper night
weak plinth
#

Is webrequest broken in 2021? I updated my project from 2020 to 2021 and suddenly webrequest.downloadhandler.data always returns null

weak plinth
#

It works in 2020, it's broken in 2021.1, but updated to 2021.2 beta and it works there.

plush flint
#

I'm new to networking (MLAPI) and I'm trying to spawn playable character, everything works as inteded, I spawn the character with ownership to the client that asked for this spawn, but then I try to get component from this client which still works but when I try to change spawnedCharacter value it doesn't change it, after calling testClientRpc() client that asked for the spawn has spawnedCharacter set to null, don't know why

#

I did find workaround around it, I would just like to understand why I can't do what I try to do

true hearth
#

Hi everyone.

I'm having a problem when i try sync the bullets between the clients. (MLAPI)

The problem is the next, when i shoot a bullet in the server work perfectly, but in the client no work like in the server.

I try with NetworkVariables like NetworkVariableVector3 but no work in the client correctly.

This is my script for shoot the bullet.

junior willow
true hearth
#

Ok, yeah, sorry

junior willow
#

Thank you

true hearth
junior willow
true hearth
#

No. In the client the bullet doesn't have force, but in the server has force. So idk what happen xd

junior willow
#

Yes that's because you need the InstanciarBalaEnTodosLosClientesServerRpc to call a [ClientRpc] to add force to the object

#

When you add force to the object, it's only adding it on the server's instance of the game, not the clients'

true hearth
#

Ok, thanks. i'll try

#

Ok, i tried, but doesn't work. I changed the code that i used in this test in the repository.

#

The Editor give me the next error

junior willow
#

No that's slightly incorrect, sorry

true hearth
#

Can you show me how I should do it?

junior willow
# true hearth Can you show me how I should do it?

Your client rpc should look like this cs [ClientRpc] private void InstanciarBalaEnTodosLosClientesClientRpc(GameObject gameObject) { gameObject.GetComponent<Rigidbody>().AddForce(-SalidaBala.transform.forward * VelocidadDeLaBala); }

#

And when you call it, you pass in the go InstanciarBalaEnTodosLosClientesClientRpc(go);

#

And make sure that your Bala GameObject has a NetworkObject component attached

#

I gotta go but I hope you can solve it!

true hearth
#

Thanks so much

frosty crystal
#

Hello.

#
            var deleteObjectRequest = new DeleteObjectRequest
                {
                    BucketName = bucketName,
                    Key = keyName
                };```
#

This is the object for deleting object from s3 of AWS

#
               var deleteObjectRequest = new DeleteObjectRequest
                {
                    ObjectReference = 
                        DirectoryArn = 
                }```
#

The second one is in my sdk but does not have proper properties.

#

Do you have any information about it.

#

thanks

compact wigeon
#

Hi, I made a photon game, I can create rooms but I cant join rooms. Can someone please help? I cant figure out whats wrong.

spring crane
#

@compact wigeon Do you see the rooms?

#

Make sure you are on the same region

compact wigeon
#

I disabled the filter

#

It was EU default

#

I will send my code

#

It connects to the master server and I can create rooms without a problem

#

But it doesnt join rooms

#

To test it, I made a build by pressing ctrl and b

spring crane
#

Display the region and rooms too

compact wigeon
#

How do I send the code?

#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Photon.Pun;
public class CreateAndJoinRooms : MonoBehaviourPunCallbacks
{
    public InputField createInput;
    public InputField joinInput;
    public void CreateRoom()
    {
        PhotonNetwork.CreateRoom(createInput.text);
    }

    public void JoinRoom()
    {
        Debug.Log("Joined in room");
        PhotonNetwork.JoinRoom(joinInput.text);
    }

    public override void OnJoinedRoom()
    {
        PhotonNetwork.LoadLevel("Game");
    }


}
#

here

#

what did I do wrong?

#

@spring crane

spring crane
#

Did you confirm that you actually couldn't join a room and it isn't just the LoadLevel method failing?

compact wigeon
#

The loadlevel works cause I use it for joining a room when created

#

I made a debug.log on the CreateRoom method and it worked

#

No error is displayed in my console too

spring crane
#

Yea I highly urge to spend a sec to build something that displays you some of the state of PUN for dealing with this sort of thing

compact wigeon
#

how do I do that?

#

I followed blackthornprod's photon tutorial video and I made the exact same steps

spring crane
#

Explore the Photon's API to see where you can poll stuff like current lobby state, region, room count etc and display it on some UI

compact wigeon
#

oh

#

@spring crane BROO

#

It works but just between builds

#

Any idea on how to fix that?

spring crane
#

From my experience it should just work, as long as everyone is definitely on the same region

compact wigeon
#

Oh yeah, one more thing, the vm cam is not following the player

#

It has in the inspector selected who to follow and who to look at

vast lantern
quaint wraith
#

What's your question ?

wispy oar
#

Does anyone know how to get a list of the ‘rooms’ that are available to join using unities mlapi?

weak plinth
#

need some help with multiplayer

#

i have a steamlobby script where one player spawns when you start host, and another spawns when someone joins through steam

#

it displays the two players on both screens

#

but when i do movement

#

it is client side

runic panther
#

nvm i fixed it i added NetworkRigidbody2D

#

it fixed a shit ton of things actually

sour briar
#

I was told to ask here, I have a unity build that works fine on PC, Mac & Linus Standalone but I can't get it working on WebGL (browser), any help is appreciated

Hi good morning/evening/night all
I've been trying to make a WebGL build of a project and already tried building it 3 times with different settings on each time, but it keeps crashing during loading and spamming those same errors on the browser console, tested on Firefox and Edge.
Is there any setting I should try changing to avoid this kind of error or any guidance? Google gives me nothing at all on those errors (feel free to ping me)
https://cdn.discordapp.com/attachments/763495187787677697/864326804424884254/unknown.png

little zinc
#

Not sure where this question belongs but I'm gonna throw it here. I have a game idea where I'd need users to have an account which they would log in through and I'd need this so I could how often certain webservice calls would be processed, etc. Think of how you want to avoid a leaderboard from having it's updates spammed, just as an example, so you'd want a token of some sort for the account which you could filter against.

#

I'm curious what the simplest option for an account system like this would be which would be somewhat secure would be, if anyone has ideas.

#

I'm not qualified to write this myself.

woven dock
#

okay using unity2020 and mirror40, i was running around, but i tried to add a new controller, both use the character controller + capsule collider. but now if my collider touches the terrain collider, player object warps to 0,0,0. if i stick a cube+box collider there scaled out, it will land on it and can run fine, but hop off onto terrain it zaps me back to origin. any ideas lol?

plush flint
#

I'm using MLAPI and when i .Despawn() gameObject, client that previously owned that gameObject will lose the ownership, is there a way for the client to keep that ownership even when the object is despawned but not destroyed?

plush flint
#

Im kinda lost with this MLAPI, when I .Despawn() gameObject, client that owned it will lose the ownership, so I decided to not .Despawn() gameObject but destroy them and if needed Instatiate them again. But when I Destroy() gameObject, host still owns it which doesn't make sense, so I try to .Spawn() it after I destroyed it because apparently host still owns that gameObject yet nothing is spawned because that gameObject literally doesnt exist

verbal lodge
#

You have to destroy / despawn on the host

plush flint
#

I know, you cannot call despawn function on the client anyway. All is done through [ServerRPC]

verbal lodge
#

I'm not sure what you mean by "when you destroy an object the host still owns it". If you destroy an object it is destroyed so where do you get that ownership information from? Also you should not do anything with a Unity Object which you destroyed, you should definitely not try to spawn a destroyed object.

plush flint
#

I know these operations after object was destroyed were just my desperate calls to figure out what is happening, basically I spawn new object for player with "metamorphosedPlayer.SpawnWithOwnership(OwnerClientId);", so at this point he has 2 owned gameobjects, then I destroy one of them and check how many owned gameObjects he has:

            Destroy(player);
            NetworkManager.Singleton.ConnectedClients.TryGetValue(OwnerClientId, out NetworkClient client);
            Debug.Log(client.OwnedObjects.Count);

And it still shows 2 which isn't correct

#

This is the whole logic:

            // Get player client that will be metamorphosed
            NetworkManager.Singleton.ConnectedClients.TryGetValue(OwnerClientId, out NetworkClient playerClient);
            playerClient.PlayerObject.GetComponent<PlayerStats>().isCharacterProp.Value = true;
            Debug.Log(playerClient.OwnedObjects.Count); // => SHOWS 1
            // First owned object is player's character
            GameObject player = playerClient.OwnedObjects[0].gameObject;
            // Get playable prop
            NetworkObject playableProp = props.playableProps[props.getIndexOfPlayableProp(hit.transform.gameObject)];
            // Instatiate playable prop
            NetworkObject metamorphosedPlayer = Instantiate(playableProp, player.transform.position, player.transform.rotation);
            // Spawn playable prop to player that will be metamorphosed
            metamorphosedPlayer.SpawnWithOwnership(OwnerClientId);
            Debug.Log(playerClient.OwnedObjects.Count); // => SHOWS 2
            // Destroy player's character
            Destroy(player);
            Debug.Log(playerClient.OwnedObjects.Count); // => SHOWS 2 ?
#

Whole script is a [ServeRpc] method, and the player gameObject after being destroyed isn't shown in unity's editor

verbal lodge
#

Yes destroy in Unity is not immediate. It will destroy the object before the next Update. During the next Update it should be no longer in the OwnedObjects lists. If you despawn it it should get removed immediately from the list.

plush flint
#

I tried DestroyImmediate, Despawn and was also checking this OwnedObjects value inside of Update() and it kept giving me 2

verbal lodge
#

If despawn returns two then that's an MLAPI bug I guess.

plush flint
#

Yea probably

verbal lodge
#

What do you need the OwnedObjects list for?

plush flint
#

I want to switch between player's character and his prop which are 2 different gameObjects without the need of destroying one and then instantiating again, simply by using Spawn() / Despawn() feature

#

But first I found out that when you .Despawn() a gameObject, client that owned it will lose this ownership what I found out to be the desired behavior, So I changed my logic to destroy gameObject if it's not needed at the time, and then I found out that host still keeps destroyed gameObject ownership, so before calling Destroy() function I call this "player.GetComponent<NetworkObject>().RemoveOwnership();" first and It looks like it's working like it should so far

verbal lodge
#

So essentially you want to despawn an object and then later spawn it again with the same owner correct?

plush flint
#

Yes that would be perfect

verbal lodge
#

I guess you could just store the owner on a MonoBehaviour on the object itself then maybe.

#

And the call SpawnWithOwnership with the correct owner.

plush flint
#

Yes another idea was to keep the owners clientID stored

#

Anyways, thank you so much for your time now I atleast know that I didn't do something incorrectly because this is my first time trying networking stuff so I'm always unsure if it's my bad or not 😄

weak plinth
#

hello I have a problem in PUN can anyone help?

#

"Failed to 'network-remove' GameObject because it's null."
that's the error I got even though I used to use the same destroy method in the same place but for some reason after i change the team i get this error

soft palm
#

I'm about to add a weapon system with client prediction, should I merge the prediction part of that weapon system with my current prediction code for movement or should I seperate it?

compact wigeon
#

Hi, I want to disconnect but it doesnt let me cause only the master client can do that, how do I set my gameobject as a master client?

half olive
#

Guys im making a game with a small team but we dont know what is more efficient: mirror or that new thing

#

For multiplayer

spring crane
#

@compact wigeon You sure you can't call PhotonNetwork Disconnect or LeaveRoom?

weak plinth
#

anyone who has had the error "Failed to 'network-remove' GameObject because it's null."