As U know, when a player stands on a slope, the angle of the slope changes depending on which direction the player is facing:
Facing across the slope - angle is horizontal
Facing directly/up down the slope - angle is the full angle of the slope negative/positive
Facing in between - somewhere between horizontal and full angle
So I tried the following projections to align an arrow, always facing forward of the player, with the slope as the player rotates:
And the pitch is correct (yay!). But the yaw is also slightly modified (red arrow) from the playerâs forward vector (green arrow), because yaw changes from being projected onto the slope along with pitch.
So now yaw is perfect, but at the certain angles the red arrow sticks into the ground (uphill) or points too high (downhill), showing itâs pitch is slightly incorrect because itâs based off of the adjusted yaw (i.e. they are out of sync).
The results are about the same using the âGet Slope Degree Anglesâ node. Actually, itâs bit better though certainly not perfect, and the difference gets worse the steeper the hill is.
Absolutely, I really appreciate your input on this. But Iâm aiming level with the ground at the same rotation in yaw as the player character.
The thing is, when I use âMake Rotator from ZXâ and âReflect Vector on Planeâ the pitch is perfect, but yaw is also affected⌠which is why the green (forward rotation) and green (reflected rotation) arenât in line.
If I try to correct this by plugging in the raw yaw directly from the player⌠yaw is now perfect⌠but pitch goes out of sync (being based on the adjusted yaw, not the raw yaw), so the arrow/box wonât lie flat along the slope reliably.
When the player faces directly up or across the slope, the arrows match exactly in yaw⌠itâs the in-between rotations where the yaw deviation occurs.