unity3d-unet

Unity3d Unet multiplayer - only server host can place buildings network aware

亡梦爱人 提交于 2020-01-06 15:52:57
问题 I am writting an multiplayer game but I am stuck with building system - I mean I've created a code to place blocks it works perfectly fine on host-side (when you run this script on host the block spawn for every client) but it isn't working on client side ( blocks spawn only for local client but not for server and other clients ). I've seen many simillar problems but no answer was found this day. Maybe you guys could give me a hand. Here's my code: using UnityEngine; using System.Collections;

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

Unity3D. Trying to send command for object without authority

落爺英雄遲暮 提交于 2019-12-28 06:43:04
问题 I have a multiplayer turn-based strategy game that needs a game manager, controlling current game state (who's turn it is etc.). This manager should be common for every client, it's state should be synchronized on server. Here's how I'm doing this: The game manager object is NetworkBehaviour and it has NetworkIdentity which is not local player authority nor server authority. I've made a custom NetworkManager and it spawns the Game Manager on client connect, also testing if it is a server.

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

Instantiated prefab scale is not displayed correctly on client

北慕城南 提交于 2019-12-23 07:56:16
问题 I have an explosion represented by a animated prefab. The prefab is instantiated when the user clicks a UI button. When the button is clicked on the client or the host, the prefab is set to localscale of Vector3(0.1,0.1,1) and is displayed correctly on the host, but at orginal scale on the client. I have a text box showing the scale on both the client and host, which match, but the display of the prefab is different on the host (displayed correctly) and client (displayed incorrectly). Again,

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

How to connect networkig player with internet

旧巷老猫 提交于 2019-12-12 04:33:41
问题 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 built-in Network Manager HUD which is provided by the unity along with Network Manager component. I am able to run and connect application on my LAN on different PCs but failed to connect it on other network . I don't know what are the reasons. Do I need to make or purchase a server for it or I am doing something wrong. 回答1: If i'm not

UNET - Sync. script for color on non-player object

余生颓废 提交于 2019-12-12 03:05:32
问题 I have tried to fix this for weeks now without succeeding and REALLY need help. I am able to sync color on my non-player objects when i initiate the color sync on the actual player object. However, the problem I have is that i want to attach a script to the non-player object that manage the color sync. I have the same for position and rotation sync that works. When i drag the non-player object i color it red and when i drop the drag i re-color it back to white. However, i get problem with

Unet Spawnable prefab not following Player Prefab on Client Side

匆匆过客 提交于 2019-12-11 18:12:36
问题 I have got a problem with Gun not sticking to a Player. It only happens for a client. As you can see on the screen, the gun position is fine for the host(Player on the right). Gun Prefab has Network Identity with Local Player Authority checked, and Network Transform, same for Player. This is my code for Player: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; public class Player : NetworkBehaviour { [SerializeField] float speed = 10f