Comments (3)
Hi Anton,
Your code seems correct. Please note that you can also access the actual data from each packet with something like the following setup below:
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityOSC;
public class oscControl : MonoBehaviour {
private Dictionary<string, ServerLog> servers;
// Script initialization
void Start() {
OSCHandler.Instance.Init(); //init OSC
servers = new Dictionary<string, ServerLog>();
}
void Update() {
OSCHandler.Instance.UpdateLogs();
servers = OSCHandler.Instance.Servers;
foreach(KeyValuePair<string, ServerLog> item in servers)
{
// If we have received at least one packet,
// show the last received from the log in the Debug console
if(item.Value.log.Count > 0)
{
int lastPacketIndex = item.Value.packets.Count - 1;
UnityEngine.Debug.Log(String.Format("SERVER: {0} ADDRESS: {1} VALUE 0: {2}",
item.Key, // Server name
item.Value.packets[lastPacketIndex].Address, // OSC address
item.Value.packets[lastPacketIndex].Data[0].ToString())); //First data value
}
}
}
}
UnityOSC doesn't support OSC bundle information yet, as it appears on the documentation. It would be your problem. Try to use another sender application (TouchOSC works for me), or bridge/filter the bundle information with another application. I am not sure if you can do that with netcat.
Hope it helps!
from unityosc.
hey jorge, thanks for the super fast response! i guess then the bundle format is the problem and as usual i didn't read the docs carefully enough... i will surely find a way to get around this!
thank you!
from unityosc.
No problem Anton! Just drop me an e-mail if you need more help.
Also feel free to implement the bundle support functionality. The UnityOSC library is an open project, collaborations are welcome :)
from unityosc.
Related Issues (20)
- Not working on Android HOT 4
- Timing Problem/Question (Packet loss?) HOT 1
- Too big latency when Recieving high rate OSC message. HOT 2
- Doesn't work on UWP (HoloLens) HOT 3
- Client Doesn't Exist HOT 1
- Get an OscBundle HOT 6
- Performance issues HOT 1
- OSCHandler GameObjects continue instantiating without being destroyed HOT 6
- Client doesn't exist HOT 5
- Send / Receive extended ASCII strings HOT 1
- Can't receive multibyte characters? HOT 1
- How to "message.add"? HOT 2
- Comparing OSC Message HOT 1
- Receiving from external IP HOT 1
- Assets/OSCHandler.cs(96,23): error CS0619: UnityEngine.Network' is obsolete HOT 1
- MIDI HOT 1
- Assets/Editor/OSCHelper.cs(41,29): error CS0246: The type or namespace name `ClientLog' could not be found. Are you missing an assembly reference? HOT 1
- impossible to tell if you have received a new message HOT 12
- Can't debug Data from Log. HOT 3
- value.GetType() use causes AOT compile issues on iOS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unityosc.