[Tech Demo] Arduino + Unity3D

edited in Projects
Inspired by LHS Bikeshed I want to try an make a game with custom inputs.

I've got my Arduino almost satisfactorily synchronising with Unity3D.



My next step is to build a prototype of the game I want to make. I have the physical components on order, hopefully arriving this week.

Comments

  • That's awesome. I have a netduino just sitting on my desk gathering dust.

    How are you mapping the controller inputs to Unity?
  • In Unity3D I switch to using the full .NET 2.0 instead of the subset; and create an instance of System.IO.Ports.Serial and monitor that each frame. I should be using events to get notified when there's data but, for some reason, the event never fires.
  • I was hoping you had some nifty way to make your arduino device be identified as an HID device. :)

    I've had endless problems with the DataReceived event before and usually end up using some other component. Lately I've been more inclined to use wireless with a simple 'input server' which then raises button/input events.
  • I've just been reading from the buffer in the Update, although I should probably move that to FixedUpdate. I probably could move it to a standard USB device but I don't have the shield for that.
  • It's probably a better idea to just read and parse the buffer in the FixedUpdate - you don't really want your controller to be changing object state at arbitrary times. An event could fire at any time and if you change the state of objects between, say, physics and rendering, things could turn ugly pretty fast.
Sign In or Register to comment.