I have this code which makes the player (car) bounce off walls by rotating it 180 degrees, but whenever it should set wall to false, it does so, but it also spams an array OutOfRangeException. How do i remove this?
The code doesn’t seem to want to display correctly, so here’s a pastebin link: Array error code - Pastebin.com
It’s the code in the if statement that is causing the problem, because it cannot access the 0th entry of the array, when the array is empty