How to rotate the forward vector to match the slope

Get formal vector to the slope surface. Project it on X-Y (ie. zero Z value).
Now you have horizontal vector that shows down the slope direction.

You also have normal vector.

You need to project that down the slope vector on plane:

Then normalize it (just to be sure)

And use line trace to draw your debug vectors.

1 Like