Detect Slope based on character position

Hello everyone, I am having small issues on how to make my character slide based on the angle/slope of the area my character is currently stepping on. I have come up with a semi solution but it doesn’t seem to work on steep areas and areas that should make a character slide. Much help would be appreciated for this, thanks!

How big are your slopes?

I would change the walkable floor angle in character movement. Then make an animation event in animbp for when character is falling call that event check the angle of slope. Do a for loop with break to get the slope value. Then if slope is greater than something play sliding animation.

No idea how heavy for looping the traces would be. If you do 4 or 5 or 8 or 9 traces and if value found break out of it. Right now you have 1 trace in the middle of character but his collision capsule has width. So if slope is 80 degrees your character will collide and start falling animation but will never give you a slope value.

You could get away without the middle trace and just have 8 traces around the sphere. Or maybe keep the middle trace for low angle slopes. Start with middle trace if that is smaller than 0 then start with up,down,left,right traces and then the in between onces. It all depends. The red dots in the images are traces from top view.

For example:

337727-image-2021-05-02-014119.png

337728-image-2021-05-02-014613.png

Just remembered there is also . You could try that also.

You want to use Normal instead of ImpactNormal

ImpactNormal tells you the direction that your line trace was pointing when it hit. You could use this for things like physics impulse or whatever

Normal tells you angle of the surface you hit. This is called a “unit vector” and it points perpendicular to the surface. So for example, if you hit a perfectly flat ground, the Normal would be (0,0,1), because it points strait up