Had to update this. Its detection system is now far more accurate. I'll post a video with how this works in maybe, like, now to three days (as of typing this it's 1/29/24). Also, please use my webcam guide. If you don't a google cardboard yet, you can test the movement mechanics by having something like headphones and temporarily attach the webcam to the top with tape. Just make sure it's looking directing forwards; any extra up or down angles of the webcam will mess with the detection. Basically, it shouldn't be tilting.
Testing Camera Motion and Direction for VR Movement =========================================== https://scratch.mit.edu/projects/938503432/ - Concept and Explanation https://scratch.mit.edu/projects/938577903/ - Changing Webcams Explanation