Quantcast
Channel: Questions in topic: "pipe"
Viewing all 89 articles
Browse latest View live

super mario pipe physics?

$
0
0

i wanna know how you would be able to stand on a certain object(pipe), and press the down key to enter it? Could someone please help? any help will be greatly appreciated!


How best to make long pipes/cables in unity?

$
0
0

Hi,

I am working on an educational game that allows museum visitors to explore various undersea environments. One of these environments is the undersea portion of an oil rig.

http://a5.sphotos.ak.fbcdn.net/hphotos-ak-snc4/58056_10150339222165467_431744650466_16137589_7115424_n.jpg

I have or can create models representing the various undersea well heads and components, and these are easy to place into a unity terrain, but I need to connect them to long pipelines that eventually lead up to the surface. I am trying to figure out the best way to do this. These are big heavy pipes, so they don't really need any physics to them. Colliders would be nice, but not absolutely necessary.

From my searches it seems like the best way to do this, may be a line or tube renderer:http://www.unifycommunity.com/wiki/index.php?title=TubeRenderer

Unfortunately, both of these require very large arrays of vector3s which I can't find an easy way to create. I would like to be able to draw a smooth vector spline into 3d space, and render it either as a shaded, or preferably a dimensional tube, and be able to tweak positioning in unity.

The other way, I guess would be to make the pipes all in a 3d program and import them in as meshes. This might be better, but it would be hard to precisely connect them to the other models in unity, and have them lie along the bottom of the unity terrain.

Any suggestions?

Thanks,

-Matt

convert c# code for unity return errors

$
0
0
I try to run c# in unity but I got errors: - error CS0234: The type or namespace name `Pipes' does not exist in the namespace `System.IO'. Are you missing an assembly reference? - error CS0234: The type or namespace name `Unix' does not exist in the namespace `Mono'. Are you missing an assembly reference? How I can to convert the code to something that run on Unity? code: using System; using System.IO; using System.IO.Pipes; using System.Net; using System.Net.Sockets; using System.Xml; #if __MonoCS__ using Mono.Unix; #endif namespace Mumble { public class Mumble { protected NamedPipeClientStream pipe; protected StreamReader sr; protected StreamWriter sw; public Mumble() { #if __MonoCS__ Socket s = new Socket(AddressFamily.Unix, SocketType.Stream, 0); UnixEndPoint ue = new UnixEndPoint(Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "/.MumbleSocket"); s.Connect(ue); NetworkStream pipe = new NetworkStream(s); #else pipe = new NamedPipeClientStream("Mumble"); pipe.Connect(); #endif sr = new StreamReader(pipe); sw = new StreamWriter(pipe); } private bool OutputStringReply() { String line; while ((line = sr.ReadLine()) != "") { Console.WriteLine(line); } return true; } private bool ReadReply() { bool reply; using (XmlReader xr = XmlReader.Create(sr)) { xr.MoveToContent(); xr.ReadToDescendant("succeeded"); reply = xr.ReadElementContentAsBoolean(); } return reply; } public bool Mute(bool state) { sw.WriteLine("", state); sw.Flush(); return ReadReply(); } public bool Deaf(bool state) { sw.WriteLine("", state); sw.Flush(); return ReadReply(); } public bool Focus() { sw.WriteLine(""); sw.Flush(); return ReadReply(); } public bool OpenUrl(String url) { Uri u; Uri.TryCreate(url, UriKind.Absolute, out u); sw.WriteLine("{0}", u); sw.Flush(); return ReadReply(); } public String QueryUrl() { sw.WriteLine(""); sw.Flush(); String reply; using (XmlReader xr = XmlReader.Create(sr)) { xr.MoveToContent(); xr.ReadToDescendant("href"); reply = xr.ReadString(); } return reply; } /* public static void Main(String[] args) { Mumble m = new Mumble(); m.Deaf(true); } */ } }

Using Pipes/Streams Freezes Unity

$
0
0
Hello, So I'm trying to get two processes to communicate with each other. Specifically a Visual C# Program that does something and sends strings through the pipe as it does it, and a Unity C# script which receives those messages. The problem is that unity, whenever I run this script (Included below) freezes and nothing happens. For the sake of testing there is an empty Unity Game Object that only has the script in it. If anyone knows anything about this problem, or can help me out, that would be very helpful. I'm using these programs from MSDN for reference on how to communicate using Pipes in C#: http://msdn.microsoft.com/en-us/library/bb546102.aspx using UnityEngine; using System.Collections; using System.IO; using System.IO.Pipes; using System.Diagnostics; public class iPhoneCommunicator : MonoBehaviour { Process pipeClient; AnonymousPipeServerStream pipeServer; public void Start(){ Console.WriteLine("Hello, World!"); pipeClient = new Process(); // Point the program to the executable pipeClient.StartInfo.FileName = "C:\\Users\\Eugene\\Briefcase\\School Documents\\CSE 4904 - Senior Design\\src\\TeamB-Code\\AirControl\\AirControlServerWindows\\AirControlServerAlpha\\bin\\Debug\\AirControlTest.exe"; // Initialize the Server Stream pipeServer = new AnonymousPipeServerStream(PipeDirection.In,HandleInheritability.Inheritable); //Set Transmission mode to bytes, since messages are not accepted pipeServer.ReadMode = PipeTransmissionMode.Byte; // Pass the client process a handle to the server. pipeClient.StartInfo.Arguments = pipeServer.GetClientHandleAsString(); // Disable Console output for the client pipeClient.StartInfo.UseShellExecute = false; // Start the client pipeClient.Start(); pipeServer.DisposeLocalCopyOfClientHandle(); } public void Update(){ Console.WriteLine("Updating"); using (StreamReader sr = new StreamReader(pipeServer)) { // Display the read text to the console string temp; // Wait for 'sync message' from the server. //Synchronize with the client, wait for a "SYNC" message do { Console.WriteLine("[SERVER] Wait for sync..."); temp = sr.ReadLine(); } while (!temp.StartsWith("SYNC")); // Read the server data and echo to the console. while ((temp = sr.ReadLine()) != null) { Console.WriteLine("[SERVER] Echo: " + temp); } } } } public static class Console { public static void WriteLine(System.Object obj){ UnityEngine.Debug.Log(obj.ToString()); } public static void WriteError(System.Object obj){ UnityEngine.Debug.LogError(obj.ToString()); } }

How do I get named pipes to work in Unity?

$
0
0
Hello, I've been trying to used named pipes in order to send data from one application to Unity, and I was thinking that named pipes would be a good idea. However, whenever I try creating the Server, I get a win32exception error so that apparently the server is never created. I can create the client, I believe, because I get a NamedPipeClientStream object with no errors, and then when I try using pipe.Connect() I get the same excact win32 error. This is probably because there is no established server to connect to. My confusion is why I can create the client, but not the server? The syntax for both seems to be the same in its documentation. Here are both the examples I ran, and the reason I am using so many namespaces is because this is part of a larger chunk of code, but maybe the other namespaces are interfering with the pipe declaration. PipeServerTest.cs: using UnityEngine; using System.Collections; using System; using System.IO; using System.IO.Pipes; using System.Text; using System.Threading; using System.ComponentModel; public class PipeServerTest : MonoBehaviour { // Use this for initialization void Start () { try{ NamedPipeServerStream pipeServer = new NamedPipeServerStream("testpipe"){ print (pipeServer); } catch(Win32Exception w){ print(w.Message); print(w.ErrorCode.ToString()); print(w.NativeErrorCode.ToString()); print(w.StackTrace); print(w.Source); Exception e=w.GetBaseException(); print(e.Message); } } } PipeClientTest.cs: using UnityEngine; using System.Collections; using System; using System.IO; using System.IO.Pipes; using System.Text; using System.Security.Principal; using System.Diagnostics; using System.Threading; using System.ComponentModel; public class PipeClientTest : MonoBehaviour { // Use this for initialization void Start(){ NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", "testpipe", PipeDirection.InOut); print (pipeClient); try{ pipeClient.Connect(); } catch(Win32Exception w){ print(w.Message); print(w.ErrorCode.ToString()); print(w.NativeErrorCode.ToString()); print(w.StackTrace); print(w.Source); Exception e=w.GetBaseException(); print(e.Message); } } } I'd also like to note that I'm not sure if this should go in a Start() function. When I use Main() I get no outputs... or maybe that's intended. [Reference to named Pipes][1] [1]: http://msdn.microsoft.com/en-us/library/bb546085.aspx

changing material color through C# script

$
0
0
Hi, The question is pretty clear. I thought it was just `renderer.material.color` But somehow the color doesn't change. Here is what I've got: I started with a puzzle, which contains several pieces (or in this case pipes). The start function of this puzzle is: // Use this for initialization void Start() { blocks = new GameObject[Size, Size, Size]; for (int x = -Size / 2; x < Size / 2; ++x) { for (int y = -Size / 2; y < Size / 2; ++y) { for (int z = -Size / 2; z < Size / 2; ++z) { GameObject o = (GameObject)Instantiate(Block, new Vector3(x, y, z), Quaternion.identity); Pipe p = (Pipe)o.GetComponent(typeof(Pipe)); p.PipeModel = PipeTypes[Random.Range(0, PipeTypes.Count)]; p.pipeColor = PipeColors[Random.Range(0, PipeColors.Count)]; o.transform.parent = this.gameObject.transform; blocks[x + (Size/2), y + (Size/2), z + (Size/2)] = o; } } } } The pipe class looks like this: using UnityEngine; using System.Collections; using System.Collections.Generic; public class Pipe : MonoBehaviour { private PipeState state; private GameObject instance; private Color pipeColorHighlighted; public PipeState State { get { return state; } set { state = value; setStyle(); } } private GameObject _pipeModel; public GameObject PipeModel { get { return _pipeModel; } set { _pipeModel = value; instance = (GameObject)Instantiate(_pipeModel); instance.transform.parent = this.transform.parent; instance.transform.position = this.transform.position; } } public Color blockColor = new Color(0.2F, 0.3F, 0.4F, 0.0F); public Color pipeColor; // Use this for initialization void Start () { pipeColorHighlighted = Color.red; // default test color State = PipeState.Default; } // Update is called once per frame void Update () { // respond to clicking etc... } private void setStyle() { if (state == PipeState.Highlighted) { print(pipeColorHighlighted); instance.renderer.material.color = pipeColorHighlighted; } else { instance.renderer.material.color = pipeColor; } //instance.renderer.material.color = (state == PipeState.Highlighted) ? pipeColorHighlighted : pipeColor; } } public enum PipeState { Default, Highlighted, Hovered, Selected } So far everything looks right. The pipes all get their correct color. But than, when I want several pipes to be hightlighted, I use this function: private void setHighlighted() { for (int i = 0; i < puzzle.Size; ++i) for (int j = 0; j < puzzle.Size; ++j) for (int k = 0; k < puzzle.Size; ++k) puzzle.getBlock(i, j, index).State = k == index ? PipeState.Highlighted : PipeState.Default; } But somehow this doesn't change anything. The colors just stay the same. I gues the problem is somewhere in the instantiation of the pipe objects. But I can't really find it. Thanks for the help

Creating piping model at runtime

$
0
0
Hello, guys! I'm rather new to Unity and I'm completely new to 3d-modeling, since I have web programming background. So I would be glad to get some advice from more experienced developers. As a programmer I'm creating an application now (С#+Unity3D) for modeling piping for transporting gas between the cities. The piping must be created and visualized at runtime. The route is calculated at runtime depending on the user's input. I wish to achieve the smooth look of my piping, taking into accout the terrain is not flat (based on real geospatioal data) and the piping length and some other parameters (diameter) are chosen by the user. I'm not sure my approach is going to work, but that's the only thing I have come up with by now. So, as I think, I have to create a prefab - a piping section - and instantiate it at runtime as many times as I need and then place these copies along the route and position them right. I haven't succeeded in my approach however. I just feel the lack of tools (or knowledge) that would help me with uniting the sections and positioning them at runtime smoothly. I tried creating a flexible section in Blender and export it into Unity (see https://www.youtube.com/watch?v=IrXAPC-PLLA) but can't export it so that I can bend it by using the key points(anyway, this is another issue). So my questions are: - is there any way to achieve the smooth look of the sections connections (so that it looks like a whole, seamless)? - Is there a conceptually better approach to solve my problem? Maybe I'm not aware of some Unity's features that make the solution easier/faster/better in terms of performance Thank you a lot for answering! I would be glad to hear any ideas you have on this topic

how to implement flowing of water

$
0
0
I'm trying to make 2D pipegame, (like pipe dream, pipe mania) I finished most of the work. but I can't find way to implement visualizing waterflow through pipe. My first thought was doing it by using masking. But is doesnt seem to work with some backgrounds. is there any other way to implement visualizing waterflow through piep?

Extruding tube animation possible in Unity?

$
0
0
I want to create and play an animation either in Unity or from Maya to Unity that has a tube's end snaking through the scene (like a more fluid Windows 98 pipe screensaver). I know how to accomplish this in Maya through a cv curve, but I don't know how to have it work in Unity. Any ideas?

Named pipe not working in release buid

$
0
0
I have a client pipe packed in a dll, that i reference in a controller created in Unity. When I run my project from Unity it self, there is no problem creating the pipe connection. But when I build the project and runs it stand alone, no connection is established. I am really lost to what is happening and what I am missing, can someone help me here?

Consume WCF Service

$
0
0
Hi all, I am completely new to Unity and this is my first post. My question is related to IPC; more precisely: I would like to use a WCF Service (via Named Pipe) in my Unity application. Thus, I copied the file *System.ServiceModel.dll* from *Editor/Data/Mono/lib/mono/2.0* to a newly created directory named *Plugins* in my Assets directory. Then, I included the following two Namespaces: using System.ServiceModel; using System.ServiceModel.Channels; And, with the following commands, I want to create a proxy of type NamedPipe: ChannelFactory pipeFactory = new ChannelFactory(new NetNamedPipeBinding(),new EndpointAddress("net.pipe://localhost/PipeReverse")); ClassName pipeProxy = pipeFactory.CreateChannel(); After I run my project in Unity, I get the following error: > InvalidOperationException: Channel type IDuplexSessionChannel is not supported. System.ServiceModel.Channels.NamedPipeChannelFactory1[System.ServiceModel.Channels.IDuplexSessionChannel].OnCreateChannel (System.ServiceModel.EndpointAddress address, System.Uri via) System.ServiceModel.Channels.ChannelFactoryBase1[System.ServiceModel.Channels.IDuplexSessionChannel].CreateChannel (System.ServiceModel.EndpointAddress remoteAddress, System.Uri via) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) System.ServiceModel.ClientRuntimeChannel..ctor (System.ServiceModel.Dispatcher.ClientRuntime runtime, System.ServiceModel.Description.ContractDescription contract, TimeSpan openTimeout, TimeSpan closeTimeout, IChannel contextChannel, IChannelFactory factory, System.ServiceModel.Channels.MessageVersion messageVersion, System.ServiceModel.EndpointAddress remoteAddress, System.Uri via) System.ServiceModel.ClientRuntimeChannel..ctor (System.ServiceModel.Description.ServiceEndpoint endpoint, System.ServiceModel.ChannelFactory channelFactory, System.ServiceModel.EndpointAddress remoteAddress, System.Uri via) __clientproxy_ClassName..ctor (System.ServiceModel.Description.ServiceEndpoint , System.ServiceModel.ChannelFactory , System.ServiceModel.EndpointAddress , System.Uri ) System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:513) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519) System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528) System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Activator.cs:338) System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Activator.cs:268) System.Activator.CreateInstance (System.Type type, System.Object[] args) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Activator.cs:263) System.ServiceModel.ChannelFactory1[ClassName].CreateChannel (System.ServiceModel.EndpointAddress address, System.Uri via) System.ServiceModel.ChannelFactory1[ClassName].CreateChannel (System.ServiceModel.EndpointAddress address) System.ServiceModel.ChannelFactory`1[ClassName].CreateChannel () IDL_vehicle.Start () (at Assets/Scripts/IDL_vehicle.cs:30)

Windows build for game using named pipes hangs on Stream.BeginRead

$
0
0
I have a standalone simple game that uses named pipes to communicate with a Windows forms application. The Unity game is built with .NET 2.0 (not 2.0 subset) and the Windows application is built on the .NET 4.0 Client Profile. My problem is that, whenever I launch the Windows forms app ("the server") and the Unity game ("the client"), if I close the client, it becomes non-responsive. It closes only after I close the server window. Below I post the simplified code for both the server and client. Any help on this issue would be much appreciated; also I would like to know if anyone can replicate this behaviour. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.IO; using System.IO.Pipes; using System.Runtime.InteropServices; namespace TestServer { public class Server { private const int BUFFER_SIZE = 1024; private NamedPipeServerStream PipelineStream = null; public Server() { OpenPipe(); while (true) { if (PipelineStream != null && PipelineStream.IsConnected) { Thread.Sleep(1000); } } ClosePipe(); } private void OpenPipe() { PipelineStream = new NamedPipeServerStream("Pipeline", PipeDirection.Out, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous, BUFFER_SIZE, BUFFER_SIZE); PipelineStream.WaitForConnection(); } private void ClosePipe() { if (PipelineStream != null) { PipelineStream.Flush(); PipelineStream.Close(); PipelineStream.Dispose(); PipelineStream = null; } } } } using UnityEngine; using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.IO.Pipes; using System.Reflection; using System.Runtime.InteropServices; using System.Threading; using System.Text; public class Client : MonoBehaviour { private NamedPipeClientStream PipelineStream = null; private void Start() { OpenPipe(); ReadAsync(); } private void OnDestroy() { ClosePipe(); } private void OpenPipe() { PipelineStream = new NamedPipeClientStream(".", "Pipeline", PipeDirection.In, PipeOptions.Asynchronous); PipelineStream.Connect(); } private void ClosePipe() { if (PipelineStream != null) { PipelineStream.Close(); PipelineStream.Dispose(); PipelineStream = null; } } private void ReadAsync() { if (PipelineStream != null && PipelineStream.IsConnected) { byte[] buffer = new byte[1]; PipelineStream.BeginRead(buffer, 0, 1, ReadAsyncCallback, null); } } private void ReadAsyncCallback(IAsyncResult result) { int amountRead = PipelineStream.EndRead(result); if (amountRead > 0) ReadAsync(); } }

How to move a ship inside a pipeline

$
0
0
Hi All! I'm developing a pipeline racing game in which a ship moves inside a pipe. I need that the movement is smooth and the ship os always touching the internal surface of the pipeline, and it rotates by side along the pipe surface. Now i have a scene setted in this way: 1) The Pipelin (flipped direction) width meshcollider and rigidbody kinematik without gravity with high mass 2) The Player, that is a empty GO with sphere collider that has the diameter of 1 - the diameter of the pipe, and a rigidbody non kinematik and non gravity with the following script 3) Childs of the Player, there are the ship and the camera. The ship is positioned at the bottom of the spehere near the pipe surface, makeing the sensation of touching it All that makes life with this C# script that controls the Player (the Sphere with attached the ship): using UnityEngine; using System.Collections; public class PipeSphereMotion : MonoBehaviour { public float speed; public float torqueSpeed; private Vector3 dir; void FixedUpdate () { RaycastHit leftHit; RaycastHit topHit; RaycastHit rightHit; RaycastHit downHit; Physics.Raycast (transform.position, Vector3.left, out leftHit); Physics.Raycast (transform.position, Vector3.up, out topHit); Physics.Raycast (transform.position, Vector3.right, out rightHit); Physics.Raycast (transform.position, Vector3.down, out downHit); dir = (Vector3.Cross (leftHit.normal, topHit.normal) + Vector3.Cross (rightHit.normal, downHit.normal)).normalized; if (Input.GetAxis ("Vertical") > 0) rigidbody.AddRelativeForce (-dir * speed); if (Input.GetAxis ("Vertical") < 0) rigidbody.AddRelativeForce (dir * speed); if (Input.GetAxis ("Horizontal") > 0) rigidbody.AddRelativeTorque (-dir * torqueSpeed); if (Input.GetAxis ("Horizontal") < 0) rigidbody.AddRelativeTorque (dir * torqueSpeed); } } Now, in the rectilinear it's all ok: the ship runs forward and strafes along the sides of the pipe, but when arrives the curve, the sphere inside the pipe rolls around... Is there a method (maybe with better raycasts, i think i do the mine wrong) to force the sphere to face always forward to the pipe irection?

Pipestream async operations disconnect server(?)

$
0
0
Hi there! I am working on a game that uses pipes to transmit some data from one process to another, and it all works perfectly when I use blocking operations (e.g. NamedPipeServerStream.Connect) but when I use their asynchronous variants (NamedPipeServerStream.BeginWaitForConnection) the pipe gets disconnected and throws an "operation completed" exception I have tested my code in my other application which runs on .NET 4.5 and it works fine there. Code: NamedPipeServerStream _pipeServer; NamedPipeClientStream _pipeClient; void WaitForConnectionCallback(IAsyncResult result) { try { _pipeServer.EndWaitForConnection(result); Debug.Log("Connected"); } catch (Exception ex) { Debug.Log("WaitForConnectionCallback Exception: " + ex); } } void StartServer() { try { Debug.Log("Creating pipe server"); _pipeServer = new NamedPipeServerStream(@"\\.\pipe\localPipe", PipeDirection.Out, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous); Debug.Log("Waiting for connections"); _pipeServer.BeginWaitForConnection(WaitForConnectionCallback, null); Debug.Log("Creating pipe client"); _pipeClient = new NamedPipeClientStream(".", @"\\.\pipe\localPipe", PipeDirection.In, PipeOptions.Asynchronous); Debug.Log("Connecting pipe client"); _pipeClient.Connect(100); Thread.Sleep(1000); Debug.Log("Cleaning up server"); if (_pipeServer.IsConnected) _pipeServer.Disconnect(); _pipeServer.Close(); _pipeServer.Dispose(); Debug.Log("Cleaning up client"); _pipeClient.Close(); _pipeClient.Dispose(); } catch (Exception ex) { Debug.Log("StartServer Exception: " + ex); } } Anyone know a fix? Thanks in advance!

Aqueducts connecting.

$
0
0
Hello, we are trying to make a mechanic in our game which acts almost like a 3D water pipe game, the code below that we used did work and then just stopped. Does anyone have any ideas why or how to get it working or any ideas to approach it. using UnityEngine; using System.Collections; public class PM_WoodAqueductTrigger : MonoBehaviour { public bool horizontal; public bool cornerPiece; public GameObject aqueduct; void OnTriggerEnter (Collider other) { if(cornerPiece == false) { if (other.gameObject.tag == "Aqueduct") { if (horizontal == true && (Vector3.Dot(other.gameObject.transform.forward, Vector3.forward) == 1 || Vector3.Dot(other.gameObject.transform.forward, Vector3.forward) == -1)) { aqueduct = other.gameObject; } else if (horizontal == false&& (Vector3.Dot(other.gameObject.transform.right, Vector3.forward) == 1 || Vector3.Dot(other.gameObject.transform.right, Vector3.forward) == -1)) { aqueduct = other.gameObject; } } } else { if (other.gameObject.tag == "Aqueduct2"&& (Vector3.Dot(other.gameObject.transform.right, Vector3.right) == 1 && Vector3.Dot(other.gameObject.transform.forward, Vector3.forward) == 1)) { aqueduct = other.gameObject; } } } void OnTriggerExit(Collider other) { if (other.gameObject.tag == "Aqueduct" || other.gameObject.tag == "Aqueduct2") { aqueduct = null; } } }

Pipe problem for interconnection between unity 5.1 and third app

$
0
0
Hi I am trying to use named pipes in Unity to pass data to and from another application. I made test Pipe Server in VS2012 static void Main(string[] args) { CreatingPipeServerLoop(); } const byte sentServerValue = 1; const byte sentClientValue = 2; static public void CreatingPipeServerLoop() { while (true) { Thread.Sleep(500); using (NamedPipeServerStream pipeServer = new NamedPipeServerStream("pipetest", PipeDirection.InOut)) { pipeServer.WaitForConnection(); Console.WriteLine("Client connected."); try { byte answer = (byte)pipeServer.ReadByte(); pipeServer.WriteByte(sentServerValue); pipeServer.Flush(); } catch (Exception e) { Console.WriteLine("ERROR: {0}", e.Message); } } } } And I made Pipe Client in Unity3d 5.1.2f1 : void Start () { System.Threading.Thread pipeThread = new System.Threading.Thread(delegate() { CreatingPipeClientLoop(); }); pipeThread.Start(); } // Update is called once per frame void Update () { } const byte sentServerValue = 1; const byte sentClientValue = 2; public void CreatingPipeClientLoop() { for (int i = 0; i < 100000; i++) { //byte respByte = 0;// MainBaseErrorExcess; using (NamedPipeClientStream pipeClient = new NamedPipeClientStream("pipetest")) { try { pipeClient.Connect(); //Console.WriteLine("Server connected."); pipeClient.WriteByte(sentClientValue); pipeClient.Flush(); byte respByte = (byte)pipeClient.ReadByte(); } catch (System.Exception e) { //Console.WriteLine("ERROR: {0}", e.Message); } } } } I started Server and then Client in Unity3d 5.1.2f1. Server connected 1-2 times then Unity crashed. Some times pipeClient threw exception "The operation completed successfully". I launched this test project on 5 PC with Windows 7 (64 bit) every time Unity crashed. It worked only on PC with Windows 7 (32 bit) and Windows 7 on Mac. Also it worked in Unity 4.5, befor I updated Unity I did not know about the problem. How to implement exchange between Unity and another application? Regards, Anatoly Frolkin.

Pipe Game ... I have to trace water from source to destination

$
0
0
I have to make a pipe water game . Like this one http://www.39games.com/arcade-games/the-pipe-game But the problem is how do i detect when the water has successfully reached the destination.... if colliders then what logic to implement ? Should i make an object that goes through the pipes ?

Pipe Game Water Flow

$
0
0
i have already done the water stuff but now i want to check whether water is in pipe....if not then destroy gameobject.....how to detect that? i mean its like if water is not in pipes then destroy gameobject.....The game is in 2D Unity 5

Type or namespace name Pipes does not exist in the namespace System.IO.

$
0
0
I am trying to use the class `System.IO.Pipes.NamedPipeClientStream`but Unity cannot find it. The build of the project works in Monodevelop but when I go over to Unity it says the following `Assets/PipeClient.cs(5,17): error CS0234: The type or namespace name 'Pipes' does not exist in the namespace 'System.IO'. Are you missing an assembly reference?` I have changed the API compatbility Level in Unity to .NET 2.0 but to no avail. Do named pipes actually work in Unity?

3D max spline animation to Unity

$
0
0
I have achieved creating a basic animation of a simple coil wire moving from being wrapped around the left side of an iron core to the bottom of an iron core. (see sequence of 3 images): ![alt text][1] ![alt text][2] [1]: /storage/temp/68035-1.jpg [2]: /storage/temp/68038-3.jpg I did this by animating a spline's verticies in 3D Max, and then just choosing to render the spline as a radial round shape to look like a fat wire. I can also achieve the radial wire shape by lofting a circle shape along the spline. The problem is that Unity does not recognize the spline, so my animation does not translate into Unity. If I make the rendered round spline into an editable poly in 3D max, the shape is imported into Unity, but I lose the animation. Does anyone know a way to bring an animated spline into Unity from 3D Max? I've tried workarounds like baking the animation, and it does not work. Thanks!
Viewing all 89 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>