This is from a @griffpatch tutorial. If you have seen it and have trouble making it work, then you can use this project. I don't mind if you use this without giving any credit to me, but make sure to credit @griffpatch because all of this code is from him. This is the exact code from his tutorial on at the end of episode 3. Watch his 4th video for more info on putting it in your own projects.