Capping an angle of a climbing system

Hello!

I am trying to make a system where you can climb up walls, I want it so if the slope is too extremely (or unextremely) angled then you can’t climb it. Such as if it were slanted outside of 45* it would stop the climb.
Here’s my code so far.
(this is in a loop)

local Raycast = workspace:Raycast(Root.Position,Root.CFrame.LookVector * 3,CastRules)
			if not Raycast then
				stopclimb = true
			else
				local Rotation = CFrame.new(Raycast.Position,Raycast.Position + Raycast.Normal)
				if Rotation.Rotation.X> 45 or Rotation.Rotation.X < -45 then
					stopclimb = true
				else
					ClimbLooker.CFrame = Rotation
					ClimbMover.Position = Raycast.Position
				end
			end

As you can see, I’ve tried checking the X angle, but this seems to just stop me from being able to climb alltogether, and this wouldnt work as the rotation is to the world space instead of the object space.

Does anyone know how i could go about this in a better method? Thanks.

math.acos(Raycast.Normal:Dot(Vector3.yAxis)) should give you an angle of zero for a surface that points straight up and 180 for one that points straight down