Skip to content

slotshaven-digitek-2018/unity

Repository files navigation

THIS EXAMPLE REQUIRES THREE OSC FLOAT VALUES. These control the intensity and direction of the spotlight.

Note: You may not notice the effect of these values on your unity project if it is running in the background, so make sure you bring it to the front of your screen.

To control Unity from Wekinator, this is what I do. (May not be the best way, since I don’t really use Unity.)

  1. Create an empty object in your scene. I called mine OSCEmpty.

  2. Add 3 scripts to this object: A) UDPPacketIO B) OSC C) OSCReceiver

  3. Make sure the OSCReceiver script is set with the following parameters: Remote IP: 127.0.0.1 Send to Port: 6448 (this allows you to send data back to Wekinator if you want) Listener Port: 12000

  4. Edit OSCReceiver to tell it how many float values to unpack from the message, and store each of these in a global variable. In my example, I am unpacking 3 floats in function Example1, and I’m setting these to variables sig1, sig2 and sig3.

  5. Edit OSCReceiver’s update() function to use the received values in some way. In this example, I’m using them to rotate the light along two different axes.

If you want to SEND data from Unity to Wekinator, check out the OSCTestSender script in this project. You'll need to edit the OSC message (i.e., make it /wek/inputs), attach any input/feature values you want (make sure you attach as floats), and send to Wekinator (by default, send to 127.0.0.1 on port 6448).

About

Repo til fælles unity packages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages