I don’t necessarily understand what you’re trying to go for here. Are you trying to raycast with a centered vertical axis relative to the face but not horizontally?
I’m trying to cast like the type of ray cast that is used for script guns but when I do that with a part the raycast would go towards the center of the part and I don’t need that, I need it to detect the mass and not the center of the part part
I mean use the kind of raycast that no matter what direction your character goes, the raycast will always point to a part but I need it not to point to the center of that part.
yeah that’s what I need because I’m trying to make a ledge grab system and I think it would be a good start for me with the type of raycast I’m needing
local Face = "Front"
local function GetFacePosition(part: BasePart, face: Enum.NormalId)
if ((typeof(part) == "Instance" and part:IsA("BasePart")) and (typeof(face) == "EnumItem" and face.EnumType == Enum.NormalId)) then
return part.Position + ((part.Size/2) * Vector3.FromNormalId(face))
end
end
-- GetFacePosition(workspace.Part, Enum.NormalId[Face])
Replace grabpart.Position in your raycast function with the output of GetFacePosition.