So I have a case where I need a raycast to follow the ground. Why I need that is pretty complicated, so instead here’s an analogy; let’s say I have a hitscan gun whose bullets are always Y units above the ground, regardless of how steep etc the ground is. The bullets only travel X distance before disappearing. So basically I need a raycast to “follow” any hills and valleys that may be in the way.
One advantage is the ground will always be low poly, so there will be few but sudden changes instead of lots of gradual changes. However the ground is not tile based, so the length and angle of my ramps will vary.
One idea I had was to make all edges of my terrain have colliders which “redirect” the raycst, like so:
but I don’t know if that will be performant. Another challenge is that I’m going to be potentially making thousands of these calls in a frame.
Apologies if this question has been asked already, my searches mostly turned up people trying to make a vehicle’s rotation follow terrain which isn’t what I’m looking for.
