unity-networking

Additive scene loading in Unity Networking-UNet

做~自己de王妃 提交于 2019-12-30 08:01:53
问题 Short Description: I am loading an Additive Scene in my Main scene , its loading fine but Additive scene's GameObject (that contain Network Identity Component) are becoming disable . Details: I am loading an additive scene through this code so that an additive scene become load into my server and all clients which working fine: [ClientRpc] public void RpcLoadLevelAcrossNetwork() { SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive); } Although it has loaded my scene into clients

Built-in Multiplayer in Unity3D without a Server?

心已入冬 提交于 2019-12-30 04:50:07
问题 I heard Unity3D has a Built-In Multiplayer functionality and it can provide the service without a server . But I couldn't find any information about it, all the turtorials I found were just about working with Photon(PUD) or Google Services. I know Photon is good, so I just started to study it and have a plan to use it. However I still want to write some very simple apps not using servers, something like One VS One Rock Paper Scissors game. Using Photon must be better on performance but in

Unity [UNET] Sync non-player object transform

冷暖自知 提交于 2019-12-24 07:26:20
问题 I have a question regarding the UNET system. There are some objects in the scene that can be picked. I want to synchronize transform that object when a player picks it up. The object has a NetworkIdentity component with LocalPlayerAuthority checked. It also has a NetworkTransform script, but the transform synchronizes only from host to clients, not the other way around. So if I move the object on the host side all clients see the change, but if the client moves it only that particular client

UNet randomly disconnects

梦想与她 提交于 2019-12-23 19:11:53
问题 I've been getting constant UNet dropouts for a basic networked scene (two player transforms and the occasional RPC). The connection drops due to a timeout. Connections reliably drop within 5 minutes, and mostly within 30 seconds. I've read online that UNet does this a lot. I've tried increasing the NetworkDropThreshold and OverflowDropThreshold up to 90%. I also put the ping timeout up to 5 seconds. Any ideas on how to fix it? I'm using wi-fi for both players, and I'm on Unity 5.6.0f3. 回答1: I

Problem in authority shifting of non-player object

删除回忆录丶 提交于 2019-12-20 06:13:26
问题 I am making a multiplayer game and I want to have player to interact with a non-player object (whose transform can be changed by any player). When I interact them with the player who joined first (or the guy who is hosting) its working but if I try to interact it with the another player (the one who joined second) the objects goes back to the location that the first player left him at. So what I tried is to shift the authority of non-player object but I am having the following errors. Anyone

Unity 5.1 Networking - Spawn an object as a child for the host and all clients

六眼飞鱼酱① 提交于 2019-12-19 03:41:39
问题 I have a player object who can equip multiple weapons. When a weapon is equipped, its transform's parent is set to its hand. I have messed around with this for some time and cannot get this to work for both the host and the client. Right now I am trying to equip the weapon on the server, and tell all the clients to set their parents transforms. public NetworkInstanceId weaponNetId; [Command] void Cmd_EquipWeapon() { var weaponObject = Instantiate (Resources.Load ("Gun"), hand.position,

How can I trigger OnPlayerConnected while using NetworkManager Unity?

≯℡__Kan透↙ 提交于 2019-12-11 06:14:24
问题 I am using UNet and NetworkManager component. I am trying to when the player connected to server just say to me 'I am connected'. I must serialize that. I am using NetworkBehaviour, I think this may lead to failure. But how can I serialize that ? Here is my code: using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; using UnityEngine.Networking; public class MultiPlayerOyunKontrol : NetworkBehaviour { void OnPlayerConnected(NetworkPlayer player) {

Unity UNET - calling [Command] outside of player object

ⅰ亾dé卋堺 提交于 2019-12-11 02:58:01
问题 So I understand that [command] does not work on non-player objects, however ...why? how am I supposed to sync data of non-player objects, such as NPC locations. The ability to call Command on non-player objects would save a lot of repeated computation time on each client. Has anyone come up with a workaround to this design decision? Also, it seems that SyncVars aren't being synced if not on player objects as-well. Right now my best strategy is to store a whoooole lot of data on the player

UNET Multi-Player game, having both players interact with gameObject, changes synchronized on host and client

梦想的初衷 提交于 2019-12-09 23:16:22
问题 I want to create a simple demo. I want there to be a cube, in the middle of a plane, that changes colors when you click it. (This was easy to implement) I want there to be two players, who take turns clicking the cube. The cube will only change colors if it is your turn. If the cube changes colors, the change will reflect on both the players' screens. I've been looking at the examples for UNET, http://forum.unity3d.com/threads/unet-sample-projects.331978/, and most of them have a networked

UNET Multi-Player game, having both players interact with gameObject, changes synchronized on host and client

此生再无相见时 提交于 2019-12-04 17:40:09
I want to create a simple demo. I want there to be a cube, in the middle of a plane, that changes colors when you click it. (This was easy to implement) I want there to be two players, who take turns clicking the cube. The cube will only change colors if it is your turn. If the cube changes colors, the change will reflect on both the players' screens. I've been looking at the examples for UNET, http://forum.unity3d.com/threads/unet-sample-projects.331978/ , and most of them have a networked character who you control with your keyboard, and this aspect is throwing me off. Do I still need to