I actually just fixed it after an hour of pulling my hair out. I put the loop before the line trace function, for some reason it didn’t want to work in that function. Kind of annoying because now I have 2 switches but it works