I need to know on which surface/axis of the part a ray contacted with. Previously I used the surface normal and through some testing found the relationship between the surface and returned normal Vector. However when I tried the same thing with a rotated part, it no longer returns values between -1 and 1. What is the math to find the surface when it a part is rotated? RayCast is a basic raycasting function that returns that part hit, position of the hit, and the surface normal.
local hit,position,norm = RayCast(startPos,direction,tool.Parent)
if hit then
wait()
print(norm)
local x,y,z = norm.X, norm.Y, norm.Z
if x ~= 0 and (y == 0 and z == 0) then
hitx = true
elseif y ~= 0 and (x == 0 and z == 0) then
hity = true
elseif z ~= 0 and (x == 0 and y == 0) then
hitz = true
end
end

3 comments
Wait so what did that do exactly?
If you look at the methods section of the CFrame page on the wiki, you'll get their explanation (as well as all the rest of the methods.) Basically, the unit vector is rotated as if the part itself is not rotated at all.
Oh nice! Thanks for the help