unity5

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;

Difficulty with rotating child around parent axes

坚强是说给别人听的谎言 提交于 2020-01-06 15:11:26
问题 I know there's a million questions on rotating, I've tried and read many things but I can't seem to solve this particular problem. The only way I can think to explain it properly is with some poorly drawn diagrams so here goes! I have a parent object, and a child object (here it's represented as a die where opposite faces add up to 7), the axes in this diagram are the parents X, Y, and Z directions Starting point: I want the child object to have two methods that I'll call RotateZ and RotateX

Detecting Google Cardboard Magnetic Button Click

落花浮王杯 提交于 2020-01-06 02:40:05
问题 I'm developing a VR app with cardboard. When I click twice on the magnetic button, I want the menu to appear. How do I write this condition in C#? 回答1: In brief, you need to detect that your phone's compass changed without any tilt (i.e., the magnet has gotten close to the phone and disrupted its compass without changing its physical orientation). You'll want to look at both vectors and see if they've changed. There's two open source implementations, the simplest of which I shamelessly

Why when i'm adding a space between the cubes on a grid the whole grid size is change?

心不动则不痛 提交于 2020-01-05 07:18:48
问题 The grid is 10x10 This is the original script before adding spaces: using System.Collections; using System.Collections.Generic; using UnityEngine; public class GridGenerator : MonoBehaviour { public GameObject gridBlock; public int gridWidth = 10; public int gridHeight = 10; public List<Vector3> positions = new List<Vector3>(); public List<GameObject> blocks = new List<GameObject>(); private GameObject[] wallsParents = new GameObject[4]; void Start() { wallsParents[0] = GameObject.Find("Top

Put UI image to Grid Layout Group Unity C#

与世无争的帅哥 提交于 2020-01-05 05:50:36
问题 I got trouble put the UI image inside Grid Layout Group in Unity. This What happen. Check the link below. [IMG] http://i65.tinypic.com/fp2dly.jpg [/IMG] [IMG] http://i65.tinypic.com/2iudlxe.jpg [/IMG] Whatever i have done change the Grid Layout Group Component : cell size value, spacing. It end with the same result like the url pic above with image gameobject cut at left side. The image gameobject size did not fix the content from the grid layout group. When i try to scroll it, it end with

Simplest way to target GameObjects properties when it triggers/collides?

蓝咒 提交于 2020-01-05 04:59:32
问题 If I have a trigger or collision I want to target that gameObject and have access to it's properties for each of the attached scripts. I managed to do it like this but I know there has to be a better method right? Here I wanted to target the script attached to the triggered game object labeled "BoxManager" and then BoxManager's property "isHeld" If the target is being selected dynamically like this when it interacts with the trigger/collision I have to use the target object, but is there a

Unity - Microphone check if silent

本小妞迷上赌 提交于 2020-01-04 09:36:29
问题 We use the standard method of recording audio in Unity: _sendingClip = Microphone.Start(_device, true, 10, 16000); where _sendingClip is the AudioClip and _device is the device name. I'd like to know when the user stops speaking, which can happen after 2 seconds, or even 10. I've looked at different sources to find an answer, but could not find one: https://forum.unity3d.com/threads/check-current-microphone-input-volume.133501/ http://answers.unity3d.com/questions/137170/how-to-check-if-the

aafdex-sdk unity3d crash on scene transition - only on Android

一个人想着一个人 提交于 2020-01-03 01:54:31
问题 I've been developing an application for emotion recognition using Affectiva's affdex-sdk (v2.2) for Unity 5.4. My application consists of 3 scenes, then I use affectiva's Camera_Detector scene, and use an emotion as trigger to go to the next scene. It runs perfectly in UnityEditor and as a Windows compiled package (x86). However when I deploy it to Android (5.0), crashes occur always at runtime when skipping from Camera_Detector scene to the next scene (scene loads previous to Camera_Detector

Enemy spawn system. I want easy enemies to spawn first then medium after that i want hard enemies to spawn nonstop. i want it a endless spawn Please [closed]

假如想象 提交于 2019-12-31 07:32:48
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Currently i have spawning system that spawns Easy then medium enemies but I'm getting Array out of range error and it's only spawning 4 of the enemies. i want x20 easy (or general number) x20 medium and then random between (easy,medium and hard enemies.) This is my Code: using UnityEngine; using System

Interestial Ads Not Showing on Live Android Device for Game Build in Unity 4.6

橙三吉。 提交于 2019-12-31 05:37:27
问题 I am using Unity Version ==> 4.6.0 Admob Version ==> Google Mobile Ads Unity Plugin v3.1.3 I am using below code to show interstitial ads. public const string adsIdAndroid = "ca-app-pub-3940256099942544/1033173712"; public void RequestInterstitial() { try { if (!AdsFlag) { Debug.Log("Requested Interstitial"); // Initialize an InterstitialAd. interstitial = new InterstitialAd(adsIdAndroid); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the