In the Dark Wood

A custom Unreal VR controller to navigate through the world. Using Arduino and an MPU6050 gyroscope sensor. Including a curated VR game to explore.

Initial Menu Room
Environment
Environment
Fail Menu
Gyroscope Device
Gyroscope Device
Gyroscope Device
Arduino Setup
No items found.
Download Process
Book

Right

I decided to experiment with different libraries I could use with the sensor. After figuring out the Adafruit library for the MPU6050 gyroscope sensor I saw that it was outputting some normal values compared to the exceedingly large values from using the basic wire library.To begin in Unreal I brought in the Arduino blueprinting on a basic cube set as a pawn. Once I go the correct values hooked in, I could control its positioning based on the sensor. I was printing the x and y values on the accelerometer to the serial monitor, then retrieving those values and setting my own parameters in Unreal to hold them. After that, I brought the Arduino coded into my VR pawn and had it add movement input based on the rotation of the camera.

Wrong

When I brought these values into Unreal I was having trouble controlling the speed of the test cube I set up. I thought it was because of the values the sensor was outputting, so I ditched the Adafruit library and moved back to my original code. It turned out the problem I was experiencing had nothing to do with the library, but to get the sensor to work at all there must be a delay in the code. The issue was being caused by the delay being too long. So, after a lot of experimenting, I could bring the value of that delay down to the point the movement of the pawn was fixed. I decided to keep using my original code because it was simpler and still gave me the values I was looking for.

Learned

I learned how to implement Arduino into Unreal. Opening up the possibility for more interactive projects. Involving the use of outside sensors and getting those to effect the virtual reality experience. I also learned how to manually change the serial port being used by the Arduino, since the code is dependent on what port the Arduino is connected to.

Accessing the serial monitor and setting up the serial port connection. Then utilizing the data from the gyroscope sensor to set custom variables to control x and y of the motion controller pawn.
Using the Arduino inputs to add movement input to the motion controller pawn.
Control the damage over time to create the time limit for the player. Also handles the win requirements for the game.
Note pickup blueprint. On overlap the note lerps to the player and shrinks. It adds to the player's note count and gives them more health.
Controls enemy movement and determines damage taken when the player is close enough.
Sets warning sound and post process effects to warn player of a creature being near.
Arduino code that takes the gyroscope data and simplifies it. That data is then sent to the serial monitor to be accessed by Unreal.
Arduino code that takes the gyroscope data and simplifies it. That data is then sent to the serial monitor to be accessed by Unreal.
No items found.