måndag 1 juni 2015

Arduino to Unity Project Part 4: Thumbsticks 8 directions input to Unity


I used the set up and Arduino sketch I had created for giving input from the thumbstick in form of a number of 0-8 to indicate a direction. I described this here: http://evertlagerberg.blogspot.se/2015/05/ardunion-to-unity-project-part-2.html



I rewrote the Unity C#-script I wrote when I tested with just one button, to act differently on 8 different states(+ 1 state for doing nothing) instead of just on/off that I had for the button. Each number indicates which direction vector is to be used in Unitys tranform.Translate()-function. When we move, we want to move along the x-axis and z-axis but be constant on the y-axis. So the vectors are:




I then added the script to the first person camera:


Arduino to Unity: thumbstick 8-directions from Evert Lagerberg on Vimeo.






3 kommentarer:

  1. Hi, I am very happy for it page, I have been found a lot of time this topic. but, Can you explain this part? whait is the code in arduino and unity? in order to do taste first. Thanks

    SvaraRadera
  2. Hi, I am very happy for it page, I have been found a lot of time this topic. but, Can you explain this part? whait is the code in arduino and unity? in order to do taste first. Thanks

    SvaraRadera
  3. Hi, I am very happy for it page, I have been found a lot of time this topic. but, Can you explain this part? whait is the code in arduino and unity? in order to do taste first. Thanks

    SvaraRadera