Checking the angle of a surface found by a ray

I am currently making a climbing system that uses raycasting to change surfaces. I have a ray for when the player needs to turn a corner, but I would like it so that the player does not turn the corner if it is at a certain angle. Here is a video of what I mean (I don’t want the player to turn the corner because the new surface is too steep):

local verticalAngle = math.asin(rayInfo.Normal.Y)

That’s in radians, so you can compare it like

if verticalAngle < math.rad(70) then
2 Likes