local po2 = root.CFrame * CFrame.new(0,0,-5)
local params = RaycastParams.new()
-- direction
local direction = Vector3.new(po2) - origin
-- send the raycast
local raycastResult = workspace:Raycast(origin,direction,params)
The distance should only be 5. That code should work assuming the root BasePart is in the position and orientation you expect. I would check that. If that isn’t the problem I would check your code that verifies the raycasts.