spring - week 2

Plan for using OSC Plugin with Unreal Engine

Step 1 — Enable the OSC Plugin in UE5

  1. Open your project → Edit → Plugins

  2. Search OSC → check the box → restart the editor

  3. That's it — no C++ needed, it's fully Blueprint-accessible

Step 2 — Create the OSC Server (Blueprint)

Open your GameMode, PlayerController, or a dedicated BP_OSCManager actor. In Event BeginPlay:

  1. Drag off and call Create OSC Server

    • Server Address: 0.0.0.0 (listen on all interfaces)

    • Port: 7000

  2. Promote the return value to a variable — call it OSCServer

  3. Call OSC Server Listen → plug in OSCServer

Step 3 — Bind Address Patterns

Rather than checking every message manually, bind specific patterns so UE auto-routes them:

  1. Call OSC Server Bind Address Pattern

    • OSC Server: your OSCServer variable

    • Address Pattern: /hand/index/x

    • Creates a delegate — right-click → Create EventCreate Matching Function

  2. Repeat for each channel you need (/hand/index/y, /hand/pinch, etc.)

Inside each bound function:

On OSC Message Received (Message, IPAddress)
→ Get OSC Message Float Array (Message)
→ Get (Index 0) from array
→ Set your target variable / call Set Actor Location

Step 4 — TouchDesigner OSC Out Setup

In your TD network:

  1. Add an OSC Out CHOP after your MediaPipe CHOP

  2. Set:

    • Network Address: 127.0.0.1

    • Port: 7000

    • Protocol: UDP

  3. Under the OSC tab, map each channel to an address:

    • Channel tx → /hand/index/x

    • Channel ty → /hand/index/y

    • Channel pinch → /hand/pinch

TD sends one packet per cook — at 60fps that's 60 UDP packets/sec per channel.

Step 5 — Apply Data to Your Splat Actor

In your BP_Tulips (or whatever actor you're controlling):

OSC float value comes in (range ~0.0–1.0 from MediaPipe)
→ Map Range node: remap to your world-space range
→ Set Actor Location / Set Actor Relative Location
   OR
→ Set variable that drives a Timeline / lerp for smoothing

Tip for smoothness: don't set position directly from raw OSC — run the value through an FInterp To or lerp each tick so the splat glides rather than snapping.

Next
Next

SPRING - WEEK 1