GMU:Tutorials/Networking/Controlling Unity with Processing: Difference between revisions

From Medien Wiki
m (1.5st draft)
m (→‎Unity: + 6.)
Line 57: Line 57:
4. Do not forget to adjust the IP, and the port in the inspector. <br>
4. Do not forget to adjust the IP, and the port in the inspector. <br>
5. In the Inspector you see the public variable gameReceiver within the Osc Receiver Script. Drag the object you want to manipulate from the hierarchy onto the gameReceiver value. By default this value is called “Cube”. <br>
5. In the Inspector you see the public variable gameReceiver within the Osc Receiver Script. Drag the object you want to manipulate from the hierarchy onto the gameReceiver value. By default this value is called “Cube”. <br>
<br>
6. If you haven't done it already - Safe! Ctrl+S on Windows, Macs probably do that differently, but you will know that better than me.<br><br>


If all this code is completely new to you and you only understand trainstation – here is an explanation for the whole OSC Receiver Script:
If all this code is completely new to you and you only understand trainstation – here is an explanation for the whole OSC Receiver Script:
Line 83: Line 83:
var msgValue = oscMessage.Values[0];</code> <br><br>
var msgValue = oscMessage.Values[0];</code> <br><br>
So you typed all that code and there are no errors but that stupid thing still won't do what it should - try Debug.Logs! Just add them everywhere! They can tell you what parts of your script are accessed after you press Play. <br><code>  
So you typed all that code and there are no errors but that stupid thing still won't do what it should - try Debug.Logs! Just add them everywhere! They can tell you what parts of your script are accessed after you press Play. <br><code>  
Debug.Log("Stakkars meg, som har skrevet 50 Debug.Logs");<br></code>  
Debug.Log("Stakkars meg, som har skrevet 50 Debug.Logs");<br></code>


== Example: Make an object jump on clapping ==
== Example: Make an object jump on clapping ==