Hey, I have an issue where my raycasts wont go any farther than maybe 0.1-0.2 studs. Do you know why this is happening?
also RaycastLocation is a part:
![]()
and is located here:

Heres my current code (Server script):
local raysettings = RaycastParams.new()
raysettings.RespectCanCollide = true
local Raycast = workspace:Raycast(script.Parent.RaycastLocation.Position,script.Parent.RaycastLocation.CFrame.LookVector,raysettings)
print(Raycast)
if Raycast then
local distance = (script.Parent.RaycastLocation.Position - Raycast.Position).Magnitude
local p = Instance.new("Part")
p.Anchored = true
p.CanCollide = false
p.BrickColor = BrickColor.new("Bright blue")
p.Size = Vector3.new(0.1, 0.1, distance)
p.CFrame = CFrame.lookAt(script.Parent.RaycastLocation.Position, Raycast.Position)*CFrame.new(0, 0, -distance/2)
p.Parent = workspace
game.Debris:AddItem(p,10)
end
Any idea why this isnt working?