Use raycastResult.Normal for blood orientation. And convert it to CFrame using CFrame.LookAt (Or function below)
local function CFLookAt2(eye:Vector3, target:Vector3, plane:CFrame)
local VectorX, VectorY, VectorZ = plane and plane.XVector or Vector3.xAxis, plane and plane.YVector or Vector3.yAxis, plane and plane.ZVector or Vector3.zAxis
local lookVector = target - eye
if lookVector:Dot(lookVector) <= 1e-5 then
return CFrame.new(eye)
else
lookVector = lookVector.Unit
end
if math.abs(lookVector.Y) >= 0.9999 then
return CFrame.fromMatrix(eye, VectorX, math.sign(lookVector.Y) * VectorZ)
else
local rightVec = lookVector:Cross(VectorY).Unit
local upVec = rightVec:Cross(lookVector).Unit
return CFrame.fromMatrix(eye, rightVec, upVec)
end
end
local raycastResult = workspace:Raycast(rayOrigin, rayDirection, raycastParams)
if raycastResult then
local Normal = raycastResult.Normal
local Orientation = CFLookAt2(Vector3.zero, Normal) + raycastResult.Position
Blood.CFrame = Orientation -- Blood is your blood part.
end
when you make a blood part you can put it in a specific folder, and using raycastparams to filter the folder to ray you are casting it will ignore the blood already there and wont stack