What game engine did you use to make this
I used godot to make this, but it would have been a lot easier to do it in an engine with particle collisions, cos then I could just send out a bunch of particles that collide with terrain instead of having a load of raycasts