Questions tagged [unet]

A multiplayer technology developed by Unity allowing easy multiplayer.

Filter by
Sorted by
Tagged with
0 votes
0 answers
36 views

Servers do not remove spawned prefab after disconnection

I built a multiplayer game with the Unity UNET. For doing this I bought a VPS server. Everything works fine. But sometimes when players want to quit the game, the servers do not destroy him from the ...
  • 175
0 votes
0 answers
207 views

Mirror Networking; How to Pass/Sync c# actions?

Since you can not pass actions as parameters to commands and rpc calls, how would you sync actions ? My main goal is to find an easy and generic way for objects to easily do actions from their local ...
0 votes
1 answer
263 views

Moving non-local player from local player with Mirror Networking

i am using mirror networking which is based on UNet. I can move non local objects easly by assigning their authority to the local player and move them, but i can't assign/remove authority for other ...
1 vote
1 answer
545 views

Mirror/Unet, RegisterSpawnHandler throws invalid asset Id error because assetId is 0 for dynamically loaded assetbundles

Its weird how documentation literally states that For more advanced uses, such as object pools or dynamically created Assets, you can use the ClientScene.RegisterSpawnHandler method But seems like ...
  • 541
0 votes
1 answer
2k views

Unity difference between accessing asset prefab from reference VS from Resources.Load?

Question point Does putting prefab asset in inspector's reference and access its content inside in runtime VS. Load the same prefab asset from Resources.Load API, ...
  • 543
0 votes
0 answers
350 views

Cost of Unity Local Multiplayer VS Unity Online Multiplayer

I know that making multiplayer games in Unity costs money because of the servers that are used in connecting the players. So basically its free upto 20 CCU and then it increases as per the CCU. Its ...
1 vote
1 answer
3k views

Peer-to-peer Multiplayer Game [closed]

I built a casual game where the user answer the right word in random question. Now I want to make this game multiplayer (4 players) working on smartphones and tablets (Androird & iOS) where all ...
2 votes
1 answer
491 views

What to use instead of UNet? [closed]

If you look at this Link you'll see UNet is deprecated and will be removed in the future. I'm developing a mobile multiplayer game, i've red official advise about it but they say "You can publish it ...
0 votes
0 answers
81 views

Reseting a multiplayer scene in UNET, without losing connections

I have a game with only one scene, which has the basic Network Manager HUD. After I click "Host", and a few players join one by one, I want to restart the scene, so the early joiners won't have ...
  • 661
1 vote
1 answer
114 views

how to detect Unity UNET errors?

I'm working on a simple multiplayer online game. and I use UNET and Networkmanager. In my game I have some rooms and players ...
  • 175
0 votes
1 answer
57 views

Unet Syncing within AR Hololens

I am out of options. I have tried everything I could and no matter what I do, the Transforms don't sync up. I have had multiple solutions that worked in my test, non AR project, but once I put on the ...
  • 11
0 votes
1 answer
24 views

Can Inspector interactions be used with UNET

SyncVar and RPC calls allow a UNET server to send messages to clients, but these messages are not triggered if the server-side change comes from the inspector or a custom editor (and presumably any ...
  • 309
0 votes
1 answer
1k views

Help needed with syncing animation speed of a player in a Networked game (Unity)

Follow-up with new code, as per below answer. Unfornutely i still have it wrong and now the character doesn't animate at all (it seems to stay at 0.00 of the clip for ever or constantly resets to 0.00 ...
0 votes
1 answer
915 views

How to use SyncVar/Command/Rpc in Unity to set the AnimSpeed for each player in the scene separately

Im making a simple as possible scene in Unity for mulitplayer game. The character has a walking animation of which the speed is to be set exactly the same as the Z velocity relative to the object. I ...
1 vote
0 answers
162 views

Spawn network objects in generated map

In my game, the server generates a procedural map, after send generation seed to generate it on the client. The client generates exactly the same map. In the map, I need to synchronize objects with ...
  • 111
1 vote
0 answers
96 views

Does Unity's Unet LLAPI compress data?

Does the NetworkTransport compress and decompress the data sent through the network?
  • 1,515
0 votes
1 answer
83 views

Message Passing b/w “LAN Server Only” and “LAN Client” on Different Scenes in Unity

I want to pass message back and forth on client and server which are on different scenes, how can I do that in Unity?** Following is my Scenario:- I have 5 scenes- BaseScene (2) OfflineScene (3) ...
0 votes
1 answer
872 views

Unity UNET, problems spawning and then destroying that instantiated prefab

I am very new to networking, and have ran into an issue, read below. I have multiplayer system setup, where players can spawn, they can pick up weapons and drop them, there is an object representing ...
  • 1,217
1 vote
2 answers
455 views

In Unity, how do I set constant player numbers such that all network clients agree on them?

We are currently writing an online game in Unity. The essential idea is that it is structured like a split-screen, couch co-op game, with the online being offered as an extension to allow multiple ...
0 votes
1 answer
150 views

How can I send commands to only certain clients?

I am building a multiplayer game server with Unity. In the game there are players moving around the map. Now, because this map is quite large compared to the number of players, I was thinking to have ...
4 votes
2 answers
5k views

How do I resolve the error "Trying to send command for object without authority."?

I don't know what I did wrong I tried couple different ways from not using commands to using SpawnWithClientAuthority. But It either gives build and compile errors ...
  • 49
2 votes
1 answer
755 views

Unity/UNet without a lobby: How do you get an ordered list of participants (network players)?

Please imagine a turn based multiplayer game. Right now there's no lobby in place and connections are established using Unity's Network Manager HUD. Now on the ...
0 votes
2 answers
1k views

Unity - DontDestroyOnLoad - FindObjectsOfType(GetType()).Length is always returning 1

I'm trying to have an object with the DontDestroyOnLoad property. I want an object with NetworkIdentity to persist across scenes, so I can have a holder script for ...
0 votes
1 answer
1k views

How do I use Unity's OnPlayerConnected method?

https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnPlayerConnected.html ...
0 votes
2 answers
4k views

How do I use Unity's TargetRPC calls? Trying to send data from the server to a client

I want to send a large amount of data to only one player, as it would be wasteful to do this for every player when only one player needs the data. After a bit of research, it appears that TargetRPC is ...
0 votes
1 answer
373 views

How to change a Variable on an Instance of a Player with Network Manager?

So I am trying to change a variable on a player object by clicking a button using Unet. However, I am having trouble getting the instance of the player object. Is there a way to get the instance of a ...
  • 243
1 vote
1 answer
406 views

Update and merge Unity coordinate systems multiplayer - Hololens

Project Summary Creating a multiplayer HoloLens app that allows players to spawn and move objects around the local space they share. Problem I am able to connect to the other HoloLens and see the ...
  • 243
1 vote
1 answer
771 views

Client not executing commands in Unet

Edit Okay, so I partially solved the problem by adding a rigid body component to the capsule. I read somewhere that apparently you have to have one in order to move on the server. Problem 2 The ...
  • 243
4 votes
2 answers
12k views

Creating a master server for Unity game (Unity 2017)

I have a basic FPS game made in Unity. I am using the Unity NetworkManager, NetworkManagerUI and NetworkIdentity components that came with Unity. The game is working fine on my local network when I ...
0 votes
1 answer
362 views

Unity low level network API

I was trying out Unity Network LLAPI, I am following the this tutorial. I wrote everything the same, my server starts well and good with no errors. When my ...
  • 129
1 vote
0 answers
348 views

[SyncVar]s in Unity with client authority

I'm making an networked RTS in Unity, and I have a problem with syncing a boolean on a non-player object. I create the object (which is a boat) using ...
  • 283
1 vote
0 answers
69 views

Unity uNet Low Level API - which values should I snyc?

I am using unitys unet low level api: TransportLayer. I send my own message by converting strings to byte-arrays. I want a server authoritive setting, so that I can try to implement my own client ...
  • 123
1 vote
1 answer
2k views

Unity Network how to move noplayer object from client side

When i drag a nonplayer object from host, client can see it, but when move the object from client, host player doesnt see any changes. How can i fix it? ...
  • 113
9 votes
1 answer
7k views

How to Send Voice over Unity Networking - UNET

I am able to Record and Run Audio from my Microphone using this code snippet: ...
0 votes
0 answers
541 views

why command is not executing on local player

I am getting very strange behavior, if my player instantiate as host (Server+Player) then my command function runs perfectly and certain object become instantiate but if I join the host then my ...
2 votes
0 answers
2k views

How to override the NetworkManager in Unet properly?

I need some customization on the NetworkManager Class for my game I'm working on. I've read, that it's pretty common to override stuff from the NetworkManager. So I've implemented the NetworkManager ...
  • 947
1 vote
0 answers
354 views

Additive scene loading to UNet

I have a main scene where my player is loading as I start or join the server. On some player action, I want to load additive scenes in to my main scene. It is loading fine on the client, but not ...
0 votes
0 answers
375 views

How to access network player from internet

I just followed a guide about basic UNet tut Here, Its spawning network car player which can be controlled by local player. I can make or join server through Network Manager HUD which is provide by ...
1 vote
0 answers
608 views

UNET (Multiplayer) calling [command] function twice

I am playing around with UNET but stuck into this weird problem/scenario while testing on same machine (unityEditor and buildRun to create "2 players/instances" The problem is weird interaction of [...
2 votes
1 answer
2k views

uNet - Client cant see server spawned objects

I'm facing a problem where when I connect with the host, all the towers spawn. After I connect with a client only to find out there are no towers visible and I can walk through them when looking at ...
  • 23
1 vote
2 answers
2k views

Unet how to control child gameobject?

I'm currently getting into the Unity networking system called unet. I have a child of the local player authority, the weapon. The weapon (PlasmaCannon_left and right) have a script handling firing, ...
1 vote
0 answers
36 views

Still players keep moving on the clients

With UNET, despite Interpolation is set to None in the NetworkTransform, I've noticed that ...
0 votes
1 answer
1k views

How to stop a host from the client script?

I am developing a two player multiplayer game. Since its only two players, I don't want to keep my connection open if a player disconnects. Now this works well from the host side, through usage of <...
  • 41
2 votes
1 answer
746 views

Unet, client is unable to control spawned units

I am trying to create a simple table top game with Unet. Right now I am just trying to get simple spawn mechanics working. The issue I am having is that the host computer can spawn and control objects ...
0 votes
1 answer
2k views

How to sync a LineRenderer in a multiplayer game?

After a lot of searching online, I have come here as a last resort for my problem. The question says it all. How to sync a LineRenderer? One answer I found was to use a ClientRpc. I tried it with no ...
  • 41
1 vote
1 answer
236 views

Unity networking, make player disappear for all clients

As title says I need to make the player disappear when he gets in car. Right now, it works as a single-player, but since I am new to unet I don't really know how to achieve this, I tried some ways, ...
  • 541
0 votes
1 answer
1k views

Server and client showing different spawned object - How do I unify them?

I have overridden OnServerAddPlayer and put some custom logic in place to set the rendered prefabs color. Something like this: ...
3 votes
0 answers
276 views

UNET Performance of (many) Kinematic Rigidbodies

I am building a game in Unity in C# using the UNET networking elements. I am trying to figure out what is the performance cost of kinematic rigidbodies? My understanding is that, when kinematic, ...
1 vote
0 answers
50 views

Kinematic rigidbodies push each other in unet

https://youtu.be/j3f44E-ExLc I have a bunch of rigidbodies on each player, ALL set to kinematic. And this stuff happens. All the sword swinging is animation state driven, and basic back and forth and ...
2 votes
0 answers
616 views

Unet spawning my 2 players in same location [closed]

I have min and max number of players set to 2. I have 2 empty game objects in my scene with Network Start Position scripts attached. I have "Round Robin" as the player spawn method in my Network ...