Category Archives: Networking

Arduino <3 Unity

I’ve recently bought myself an Arduino Uno R3 kit and I’ve built myself some simple projects to get a feeling of what is possible with this stuff! Having little to none experience with microcontrollers I must say the Arduino is quite simple to get into, and the community is awesome with ALOT of tutorials and questions answered online! Much like the Unity community! One of my first projects was to try to get the arduino to communicate with Unity! My plan was to make a gyro-accelerometer for use with my computer! 

For this I paired the Arduino with a  Wifi-Shield(ESP8266) and a GY-521(MPU6050) 6DOF gyro/accelerometer. I set the esp8266 to be a client, hooked up to my computer as the server. I used a free library for handeling the gyroscope which converts the gyro/accel raw data to quaternion rotation and sends it as a string on the serial line. The ESP8266 transmits the string over TCP to the server. 

In Unity i set up a TCPListener on a seperate Thread that continuesly reads the strings from the Arduino and converts string back to quaternion rotation.

In operation it looks like this:  

 The setup is not very accurate so not very useful, but fun project to get working! 

Now I’ve started working on something else! Bigger, better and more beautiful! 

Slow, not stopped

Progress on Battle Maze has been really slow for quite a while, but not as slow as the updates on this site. I’ve gotten sidetracked by alot of other projects, and personal stuff. Projects I’ve been working on is updates to 3ounce and other apps I’ve made, and I started working on a new game that I probably will never finish. But I’m now back to working on Battle Maze again, and progressing slowly. I’ve decided to use the new UNET Networking API introduced in Unity 5.1 for network games in Battle Maze. So far it seems quite simple to set up, and things are actually working. Documentation of the new API is a little lacking at the moment though so I have to google-hunt a lot to find solutions for simple problems that pop up. But it’s getting there.. I think! I’ve changed alot of the way the game plays lately so I’ll come back with some screenshots and maybe videos soon!