Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

[RELEASED] UniOSC - OSC solution for Unity

Discussion in 'Assets and Asset Store' started by _monoflow, May 21, 2014.

  1. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    UniOSC - OSC solution for Unity

    With UniOSC you can setup and monitor your OSC connections with just a few clicks.

    Features:


    • No coding for OSC ready system
    • Send and receive OSC data
    • Supports OSC Bundles
    • Works in editor play mode
    • Use TouchOSC as a remote control
    • Trace data flow
    • Change settings at runtime without reconfiguration
    • create your own Editors or GUI apps to send& receive OSC data
    • scripting classes for coders who don't like components
    • Works in Unity Free (Publishing for mobile with Unity 4 needs Unity PRO)
    • Works on all major platforms (Win, OSX, IOS, Android)
    • Unity 5 ready
    • C# source code
    • Documentation


    Now available : http://u3d.as/content/monoflow/uni‐osc



    Here some videos to see how UniOSC works.


    Basic setup



    Connection States



    Data mapping





    With UniOSC TouchOSC you can use your mobile device as a remote control for your Unity apps or the Unity editor!
     
    Last edited: Apr 29, 2015
  2. 22

    22

    Joined:
    May 22, 2009
    Posts:
    63
    Very intersting. What range do you support?
     
  3. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    What do you mean with 'range' ?
    It runs with Unity Free on Win, OSX, IOS, Android.
    You should use at least Unity 4.5.5
     
    Last edited: Apr 29, 2015
  4. gregzo

    gregzo

    Joined:
    Dec 17, 2011
    Posts:
    795
    Great job, the asset store really needed this!

    Gregzo
     
  5. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Many thanks Gregzo!


    And in combination with G-Audio you could create real cool audio media installations ;)
    I try to setup some demos to show how convenience it is to use TouchOSC to control Unity. And G-Audio is one of the assets on my example list .
     
  6. gregzo

    gregzo

    Joined:
    Dec 17, 2011
    Posts:
    795
    Great! Let me know if you need G-Audio's package, I'll send you a link.

    I hope to find some time soon to do something myself with both TouchOSC and G-Audio, time is scarce these days!

    Cheers, and best of luck on the Asset Store,

    Gregzo
     
  7. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Thanks for the offer but I already bought a licence.:)
     
  8. gregzo

    gregzo

    Joined:
    Dec 17, 2011
    Posts:
    795
    Ha!

    Just bought UniOSC myself, trying it out now.

    Very clean, nice and pro. Congrats!

    A few questions:

    1) I'm extending UniOSCEventTarget, how do I receive all messages for the port, regardless of the address?

    The keyboard in touch OSC communicates key index through the address parameter:
    /8/push24 for example, where 8 is the current tab, push the instruction, 24 the index of the key. Data is just 0 or 1 ( press / release ).

    2) Any classes in UniOSC that help parsing addresses, before I go along and code something myself? It seems mapping is only for the data parameter, anything for the address? It'd be great to setup in the inspector the address root and the message type: /8/push*, and just get 24 on or off in an override.

    This is gonna be fun, I really need to make some time to dig into it further.

    Cheers,

    Gregzo
     
  9. gregzo

    gregzo

    Joined:
    Dec 17, 2011
    Posts:
    795
    Actually, all you need to do is to make the _IsDispatchable method protected virtual instead of private. It would make sense to let users override this, and dispatch further themselves.

    Gregzo

    Edit: it seems you do have a receiveAllAddresses flag, it simply doesn't show up in the inspector.
    Should be an easy fix.
     
    Last edited: May 24, 2014
  10. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    As you mentioned you should set the receiveAllAddresses flag ,so you don't have to write all the OSC addresses you want to receive by yourself.
    Then in the OnOSCMessageReceived method you can do something like this:
    Code (csharp):
    1. public override void OnOSCMessageReceived(UniOSCEventArgs args) {
    2. if(args.Address.Equals(YOUR_ADDRESS_STRING_A)){}
    3. if(args.Address.Equals(YOUR_ADDRESS_STRING_B)){}
    4. .....
    5. (Or a loop if you want to prevent too much if clauses)
    6.  
    7. }
    I think this is the easiest way to parse different addresses with one script.
     
    Last edited: May 24, 2014
  11. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    In general you have two options to receive multiple OSC addresses in a script.
    If you look at the UniOSCChangeColor.cs script you see a variant where you filter addresses:
    Code (csharp):
    1.  
    2. private void _Init(){
    3.        
    4.             receiveAllAddresses = false;
    5.             _oscAddresses.Clear();
    6.             _oscAddresses.Add(R_Address);
    7.             _oscAddresses.Add(G_Address);
    8.             _oscAddresses.Add(B_Address);
    9.            
    10.             ......
    11.         }
    12.  
    13.  
    14.  
    15.  
    16.         public override void OnEnable(){
    17.             _Init();
    18.             base.OnEnable();
    19.         }
    20.  
    21.  
    22.  
    23.  
    24.  
    If you set the receiveAllAddresses flag to false you have to add your addresse before base.OnEnable() is called.

    The other way is like above where you set
    Code (csharp):
    1.  receiveAllAddresses = true;
    I know that it is easier to let receiveAllAddresses always true as you have to filter the addresses in the OnOSCMessageReceived method anyway, but I thought it would be better for performance if you could filter in an earlier step so OnOSCMessageReceived is not called everytime.
    Don't know if this is 'overengineering' :rolleyes:
     
  12. gregzo

    gregzo

    Joined:
    Dec 17, 2011
    Posts:
    795
    Yeah, just seemed that since there's a toggle for listenToAllPorts, one for receiveAllAddresses would make sense too ( in the inspector I mean ).

    The way I'm doing it for these push messages is to find out if the string contains "push", and parse the number after that.
    string.Split( '/' ) is also nice to retrieve tab index.

    One other question: I'm getting very variable latency, from very good to very bad ( up to a few seconds, and sometimes messages dropped altogether ). Your videos seem to run at a stable, pretty decent latency - is my router to blame? Using TouchOSC on iPad 3. Getting the issue both in the editor and in builds, sending messages from the iPad to an iMac.

    Could it be a UDP issue? In your videos, you're demonstrating constant input mostly, not so much unique messages as in key presses.

    I'll try on another network to make sure. In the meantime, any insights are welcome!

    Btw, super easy to setup, very enjoyable.

    Cheers,

    Gregzo
     
  13. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    I will make this option in the next release adjustable in the inspector. (Right now you could comment out [HideInInspector] in the UniOSCEventTarget.cs class.)

    In the documentation I mentioned a point under 'Common pitfalls':

    'When you use the gyro data from TouchOSC other OSC controlled objects that listen on the same port canbegin to react sluggish. It’s best to use a separate device for the gyro and use another device on another port
    for the other GameObjects.'

    Perhaps this causes the latency. Don't know if this is an general TouchOSC issue or if there are problems in my implementation. I will investigate that, but I suspect that this is an TouchOSC issue as it seems to work when you use a explicit port for the gyro.

    Thanks! Good to hear that the setup is easy for others. :D
     
  14. gregzo

    gregzo

    Joined:
    Dec 17, 2011
    Posts:
    795
    Just solved my latency problem:

    Creating an ad-hoc network is the way to go.

    Might seem super obvious, but for OSC noobs like me, it's not the very first thing I thought of.

    Anyway, working great now.

    Thanks for the high quality package, I'll have the honor of posting the first review!

    Cheers

    Gregzo
     
  15. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Great news!
    I will update the documentation so others are directed into the right solution.

    Many thanks for the review and the feedback :D ! It's good to know that UniOSC is also an useful tool for others.
    Feel free to post a video with your results. As UniOSCs benefit is a little bit of abstract it's always good for other to see how you can change your workflow in the editor or at runtime.
     
  16. valyard

    valyard

    Unity Technologies

    Joined:
    Jun 4, 2010
    Posts:
    291
    Good job.
    Was surprised to see my OSCsharp library within the files q:
    And you are right, it has a problem with iOS and WP8... it doesn't really work there.
     
  17. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Standing on the shoulders of giants :cool:
     
  18. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Just submitted version 1.1 :

    Session fil​e support:
    – Store the latest data that comes with a OSC message
    – Send all data to update the GUI state of an external app like TouchOSC

    - Change in OSCsharp lib: made the TypeTag property of a OSC message accessible
    -Type of the OSC data could now be verified with the Typetag string. (No GetType() necessary if you have performance problems)
    - receiveAllAddresses property is now accessible via the component inspector
    - UniOSCEventArgs could now be filtered by Group, AddressRoot or AddressIndex if the OSC address matches a specific pattern
    - Documentation update

    I will make a video of the session feature so you can see how useful it is to update the GUI of TouchOSC to your last settings.
     
  19. gregzo

    gregzo

    Joined:
    Dec 17, 2011
    Posts:
    795
    Good news, very happy to see that everything I was missing is now included ;)

    All the best,

    Gregzo
     
  20. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Submitted a hotfix version 1.1.1:
    Scenes could not be published.
    Method SelectObjectInHierachyFromGUID with editor related calls where moved to another section inside UniOSCUtils.cs

    Sorry for any inconvenience.
     
  21. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Version. 1.2 is now available :

    - UniOSCEventDispatcher can now send more than only one float value as data. You can add as much data as you want as long as the data type is supported by the OSC protocol (Int32, Int64, Single, Double, String, Byte[], OscTimeTag, Char, Color, Boolean)

    - Added a UniOSCEventDispatcherImplementation class as a blueprint for OSC sending components.


    - Added External InputDevice scripts (Third party Assets need to be installed to work) :

    -Send OSC data with the SpacNavigator Controller (Asset from Patrik Hogenboom) : https://www.assetstore.unity3d.com/en/#!/content/9774

    -Send OSC data with Razor Hydra Controller from Sixsense Studios: https://www.assetstore.unity3d.com/en/#!/content/7953

    - Unity 4.5 Bug fixed (Tracing of OSC messages causes an exception when there were more than 15000 chars in the TextField). Tracing TextField now displays maximal 8192 chars.
     
  22. plugisto2

    plugisto2

    Joined:
    Aug 12, 2014
    Posts:
    1
    Hi!

    I just bought UniOSC. I really like it so far.
    Though one problem: when I try to compile the mobile demo scene I get an Error message:
    "Error building Player: SystemException: System.Net.Sockets are supported only on Unity iOS Pro. Referenced from assembly 'Assembly-CSharp'."

    I thought it would work with Unity Free?! Is there a workaround?
    Thanks!
    Eugen
     
  23. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Sorry at this time there is no workaround as this is a restriction of the mobile version (iOS/Android) of Unity Free. (Unity removed that feature from the free version in version 3.5.6)
     
  24. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Hi,
    I came across a great asset on the Assetstore : Flux - The Cinematic Editor For Unity. I managed to extend it so it is possible to send OSC data with this tool from a timeline (in combination with UniOSC). With this editor it could be possible to create some kind of app like Vezér . (A OSC Timeline Tool).
    Feature requests or suggestions for such an addition are welcome.
    [Edit]Flux support comes now with version 1.6[/Edit]
     
    Last edited: Apr 29, 2015
  25. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    848
    Hi. I had late night problems with my OSC scripts and ended up buying UniOSC. I think It's too pricy, but thank you, it did save my butt.

    Question: How do I avoid the "Error sending an OSC packet to X.X.X.X:XXXX" warning message? I get it repeatably as long as the message I'm sending from UniOSC is not recieved. This crowds my console and slows down everything. I may want to connect and disconnect devices on the go.

    Thanks
    Carl Emil

    Full warning:
    System.Exception: Error sending an OSC packet to 127.0.0.1:6000
    at OSCsharp.Net.UDPTransmitter.Send (OSCsharp.Data.OscPacket packet) [0x00000] in <filename unknown>:0
    at UniOSC.UniOSCTransmitter.SendOSCMessage (System.Object sender, UniOSC.UniOSCEventArgs args) [0x0000b] in /Users/carlemail/Work/UnityMain/Assets/UniOSC/Scripts/UniOSCTransmitter.cs:92
    UnityEngine.Debug:LogWarning(Object)
    UniOSC.UniOSCTransmitter:SendOSCMessage(Object, UniOSCEventArgs) (at Assets/UniOSC/Scripts/UniOSCTransmitter.cs:95)
    UniOSC.UniOSCConnection:SendOSCMessage(Object, UniOSCEventArgs) (at Assets/UniOSC/Scripts/UniOSCConnection.cs:590)
     
  26. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Hi Carl,

    glad to hear that UniOSC saved your butt.
    To bad that you think it is a bit overpriced. I spent a lot of work to fine tune this package so it is more than just another OSC package, as there are some open source solutions floating around. Making a solution that just enables two computers with OSC is one thing, making a solution that gives all the tools so that you don't have to mess with all the integration and debugging stuff is different from that (Especially for non coders) .

    To your question: the error message comes from the used OSCsharp lib . As far as I know there is no connection check feature implemented. For a quick fix you have two options:
    Enclose your send call in a try/catch clause . The console warning should be suppressed. (But I don't know if the performance problems will be totally resolved.)
    The other solution is to create a script based on the UniOSCEventTargetImplementation.cs file that reacts on a special OSC message that is sent from a device when it connects via OSC(you can append the ip-address as data). Then you can set a flag in your code .(If the flag is false you know that there is no reliable connection to the device and any attemp to send should be blocked .)
    PM me if you need further assistant.

    I will make a demo script for the next UniOSC version as it is a common problem that should be handled right out of the box.
     
  27. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    848
    Thanks for writing back so fast. I think many things in the AssetStore are priced too high, so don't take that personally. I'm very impressed with edtior UI design and there is a whole bunch of stuff in your code I can learn from.

    Solution1 (try/catch) does not seem to supresss the warning. Solution 2 could work and since I'm sending to a Max patch it's easy peasy. But there should be a simpler way to suppress the warning. Any chance you can edit the OSCsharp.Net.UDPTransmitter.Send method and recompile the OSCsharp.dll?
     
  28. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Hi Carl,
    I made some test and realized that the problem is not comming from OSCsharp.dll but from the UniOSCTransmitter.cs
    (Line 95 ). There is a Debug.Logwarning() that you can comment out.

    But there seems to be a general problem with the mono implementation for OSX/IOS. You will always get this message:
    "_wapi_send: Need to translate 64 [Host is down] into winsock error"
    Don't know if this message could be suppressed. (https://github.com/mono/mono/blob/master/mono/io-layer/sockets.c line 1014) . I have to make further tests.

    FYI: If you have problems with the OSCSharp.dll you can tweak it for your needs as it's open source (Just remove the dll and integrate the source version: https://github.com/sloopidoopi/OSCsharp
     
  29. tomtong

    tomtong

    Joined:
    Aug 5, 2013
    Posts:
    17
    Hello. I am making a mobile app which control my robot arm with UniOSC. Could I enter the remote IP and port directly in the app UI?
     

    Attached Files:

    • ps.jpg
      ps.jpg
      File size:
      111.4 KB
      Views:
      1,099
  30. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Right now this is not implemented. I will change that for the next version. If you need the script right now you can PM me and I can provide you the changes without waiting for the Assetstore release.
     
  31. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Version 1.3 submitted

    – "Explicit Connection" option in OSCEventTargets and OSCDispatchers:

    This option is very handy if you have a setup where you want the flexibility to change your port or IP-Address of a OSCConnection, without to reconfigure all your OSCEventTargets or OSCEventDispatchers. So now you have the option to bind to a connection and don’t have to specify a given port or IP-Address.

    – Updated the Mobile.Demo scene where you now can change the port/Ip-Address of your OSCConnections at runtime via the GUI.( Your components have to use the Explicit Connection options to work with changing settings).

    – Added a JavaScript demo unitypackage to give a starting point for JS programmers. (But it is not recommended to script in JS).

    – Documentation updated

    So with the new Explicit Connection option you could create a much more flexible setup with zero administration effort.
    @tomtong: thanks for pointing me in the right direction with your feature request.
     
  32. ianjgrant

    ianjgrant

    Joined:
    Mar 11, 2013
    Posts:
    28
    UniOSC is a wonderful asset. It has cut the set up time for the digital puppets in my performance animation system, the ShadowEngine, from hours to minutes. The connection manager, address mapping and re-scaling, session state / data persistence, example code and useful components and good documentation... wonderful!
    Thank you Monoflow!
    Kind regards, Ian
     
    _monoflow likes this.
  33. ianjgrant

    ianjgrant

    Joined:
    Mar 11, 2013
    Posts:
    28
    Hi, is it possible to listen for an OSC message in an editor window script? A short example would be very helpful! I'd like to trigger functions called by GUI buttons via TouchOSC.

    Kind regards, Ian
     
  34. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Many thanks for the kind words. Glad to see that your workflow could be improved so much.

    Sorry, at the moment this is not possible without do the scripting by yourself. The problem is that the current scripts are MonoBehaviours and as far as i know you can't add this to an Editor via AddComponent or the new keyword.
    For the next release i will add some stuff that is more code related to address your issue. So that you have a Dispatcher / EventTarget class that you can instantiate from code in Editors.
     
  35. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Version 1.4 submitted

    - Class based versions of OSCEventTarget and OSCDispatcher
    You can now handle OSC messages in classes that don't derive from MonoBehaviour. This makes it possible to work only in code and in editors
    - Created a demo editor to show the new class based feature to use in Unity Editors
    - Added a demo scene with class based sending and receiving
    - Fixed a bug with the explicit connection mode (OSC data of OSCEventDispatchers was always
    reset when a status changed event was fired from a OSCConnection)
    - Added a ClearData method to the OSCEventDispatcher class so you can clear the OSC data
    - Added an OSCMessageReceived event to the OSCEventTarget classes. This event is additionally fired when the OnOSCMessageReceived method is called
    -Documentation update

    This new update is more for coders who want to create a OSC setup from scripts. I tried to provide all the features you have with components. The only thing you can't create from code is a OSCConnection.
    @ianjgrant : You can now script your own editor to send and receive OSC data. :cool:
     
  36. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Version 1.4.1 submitted

    Just some minor fixes :

    - Fixed bug in UniOSCConnection: You can now change the IPaddress with the GUI at runtime and get visual feedback if you enter a non valid address. (In the mobile scene demo )
    - Changed datatype of UniOSCEventDispatcherButton message data from int to float (Was wrong initialized as int )
     
  37. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    I realized that with the latest update to the Assetstore there was also uploaded a UniOSC.temp folder by mistake. The folder is only for internal testing.
    This can cause a lot of confusion and your scenes will probably not run the right way.
    Please delete this folder! And restart Unity.
    I will update the version on the Assetstore. Sorry for any inconvenience.
     
  38. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    The AssetStore package manager upload tool makes me crazy! With the latest update (Vers. 1.4.1b) there is now a UniOSC_temp folder beside the normal UniOSC folder. Please delete this little sucker .:mad:
    Hopefully with the next update the problem is gone. Sorry for all the confusion.
     
  39. EricMotion

    EricMotion

    Joined:
    Feb 5, 2015
    Posts:
    2
    Hi. I've been fiddling with UniOSC for a little while. Noob coder, but I really want to be able to use this asset for 3d position movement along x,y,z. The provided scripts are wonderful, but seem to be geared toward GUI developing. Basically I want to control an objects transform.position globally around an environment.

    For example, I use the Lemur osc app a lot, it has an object similar to an xy pad in TouchOsc, except it is circular. So I get x and z data from one control (imagining a top-down view). A fader would act as the y height data. I've attached an image of the interface.

    I'm wondering if there's any info available as to how I could achieve this? A way to get my osc information to globally move a gameobjects transform.position....?


    Many thanks for any help, and as well for the awesome asset!
    -e image.jpg
     
  40. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Hi Eric,
    UniOSC comes with one script (UniOSCMoveGameObject.cs) that shows how to move a gameobject. I don't know what you exactly mean with globally movement. There are several way to specify your movement. In the example script i only map the values that are normaly between 0 and 1 with Camera.ScreenToWorldPoint() to get a movement that stays in the camera frame. You can also use the values to map them to an imaginary volume that defines your movement volume or use the value to add some speed or force to your movement so you are not constraint in a volume (Would be more like a joystick control). If you need more help it would be better to contact me directly (info@monoflow.org)
     
    EricMotion likes this.
  41. EricMotion

    EricMotion

    Joined:
    Feb 5, 2015
    Posts:
    2

    Hey, thanks for the reply. Im working up a script right now. If and when I get stuck, I'll definitely contact you. Thanks again. ;)
     
  42. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I'm almost bound to get this because it is on 24 hour sale. But just before I do, any ideas if it works OK with Unity 5?
     
  43. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    I will publish a new version within a short time. There was only one minor problem with the new API (just one line of code in one class: renderer -> GetComponent<Renderer> ) so i can confirm that it will run under Unity 5.:)
     
  44. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Excellent, and thanks for the swift response :)
     
  45. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Version 1.5 submitted

    • Unity 5 ready
    • Added Editor Mode
      • You have to enable the editor mode now explicit in the UniOSC Editor to route your OSC data to the Components when your not in play mode.
    • Changed the Component Inspector for Dispatchers and Receivers
      • The base Inspectors are now drawing the DefaultInspector
      • You can now create your own scripts based on the UniOSCEventTarget & UniOSCEventDispatcher and all public properties are displayed right out of the box. (You don’t need to write a custom inspector any more to show your own public properties :) )
    • Added a Mode option at UniOSCMoveGameObject.
      • You have now a Screen mode (like before) and a Relative Mode (additive movement that is not bound to the camera rect)
    • Added a UniOSCTransformSender component for sending the transform data (position & rotation) of a GameObjects continuously
    • Documentation update
     
  46. ianjgrant

    ianjgrant

    Joined:
    Mar 11, 2013
    Posts:
    28
    Thank you for the recent updates! This asset has totally improved my workflow on my multi-iPad digital puppetry project and is brilliant for installations and interactive exhibit workflows. Two questions: I wonder: do you have an example of how one script, with public variables, can send that data to a list of OSC addresses setting, for example, presets on TouchOSC. Also, an example of how an editor script and receive and send to multiple address (again, I'm interested in keeping UI in sync between Unity and an external device. I think I could use the mapping files? I thought I could work this out - but my brain has frozen! Kind regards, Ian
     
  47. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Hi Ian,
    to synchonize the actual settings of your Unity scene with TouchOSC for example you should use a Session file. This records all data that correspond to the addresses you define in this file.(You can use the 'Add Items from file' option in the UniOSC Editor to copy all addresses from a Mapping file right into the Session file). In the inspector of your OSCConnection component you will see a button 'Send Session data' when you have added a Session file to the OSC Connection. When you hit this button all the data from the Session file is send out to you external OSC device to update it to the current Unity state.(Sometimes you have to hit the button twice). Please look at the documentation where i explain everything). I have to improve the Session feature for play mode a bit, but in editor mode it should work in an appropriate way.
     
  48. slampants

    slampants

    Joined:
    Oct 27, 2013
    Posts:
    7
    Hi! I'm really excited about this. I'm an amateur developer and have been trying to implement UnityOSC into a project I'm working on, and needless to say your plugin looks WAY more efficient for me!

    I have a couple of questions before I purchase:

    1) Just want to confirm... I can use this with any OSC system, not just TouchOSC right?
    2) Is it possible to set it up so that when a button is pressed in the OSC client, the game treats the signal as "GetButtonDown" and when the button is released, it's interpreted as "GetButtonUp"?

    Thanks!
     
  49. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Hi slampants,
    1) Yes. Every OSC capable device can communicate with UniOSC.
    2) Normally if you want to send an on/off state you sent 0 & 1 as data. In Unity you can then parse that data in a diiferent way. In my UniOSCToggle component i assume that the data is 0 or 1 and do the conversion with
    Code (CSharp):
    1. toggleState = Convert.ToBoolean(args.Message.Data[0]) ;
    With this you have your down/up state info as boolean value.
     
  50. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Some good news:
    With Unity 5 the free personal edition has all features that the Unity pro version has. This means that you can now publish also for mobile platforms with the free version of Unity and UniOSC works. :)