[ad_1]
Because the system you might be utilizing is at the very least partially profitable, I’d recommend there are two choices right here:
The intermittent drawback is as a result of capsule collider on the Player Controller and (I assume) choosing the primary collision hit within the listing. You may attempt grabbing all of the hits into an array and loop over them to search out the one with the bottom, or highest, Y worth – then use this together with your present regular examine. The nature of the collider’s form can throw up a lot of hits, and their order isn’t at all times assured.
The second possibility, and the one I used after I wished to change stroll velocity based mostly on slope, is to fireside a ray down from a set level in entrance of the character, and use the distinction in peak between the participant rework’s Y and the ray hit’s Y to find out the slope. This is extra correct as you might be sampling a single level.
[ad_2]