
So id like to fix this glitch ive run into but have found no way around it

so this is how its supposed to be
https://gyazo.com/aa3ef8b48c5e883645065927acf18567
https://gyazo.com/cc63fac0b6871d46dd2d659edab96005
but if u go behind the cylinder, the wall is rotated into the negative z direction the method that im currently using to rotate the player to the wall glitches and rotates into the wrong direction
https://gyazo.com/2f3785e27b46fbb84ea80d37eb90afe5 
so the method im currently using is rotating the character on the y axis via this
hrp.Orientation = Vector3.new(hrp.Orientation.X,math.deg(math.asin(ray.Normal.X)),hrp.Orientation.Z)
obviously this is all supported by a raycast that is sent in a heartbeat function when the player holds a or d so i can dynamicly move and rotate them, thats why u can go around a cylinder.
ive tried switching it to sin; cos; acos; atan; the absolute value of asin; negative ray normal; negative degree (gives the same result as negative ray normal) switching the normal to the y normal or z normal.