Monday, 15 April 2013

UnityWii Issues

I have tried vigorously to get some sort of wii mechanics working which would allow the user to steer their car via wii-mote however I have ran into a few issues trying to do it.

The main issue is that the wiiyourself library is in c# language and my car movement script in javascript. Obviously it is very difficult to use variables between different types of scripts and this has proved problematic. I have tried creating a javascript variable which allows me to add the script in to access these variables which initially worked out fine.

I would have preferred to do it the other way around by accessing the c# script in my javascript file however for some reason the new version of unity doesn't allow what it did in the previous versions and after roughly 30-45 minutes trying I simply could not access the c# variables in the javascript.

I then set a couple public float variables called pitch and roll in javascript which I would then use set in the update method equivalent to the pitch and roll values of the wii remote. However after adding a similar script as above I finally realized the variable values weren't updating so nothing was happening to the cars.

After having thought through every possible solution I could I looked online for help but was just given the same sort of solution that I have already implemented. I will write another blog shortly when or if I come up with a solution.

No comments:

Post a Comment