WorldRoot:Raycast bug?

I want to raycast from a part’s position directly downwards and if any part is hit then it would generate a second part visualizing the hit.
I’m not sure why but it is acting like a lerp function? It generates parts from an offset and those parts get closer and closer to the casting position.
I’ll try solving it, but any reply could potentially speed up the process, in which case I’d be very grateful.

while true do
	local params =
	params.FilterDescendantsInstances = {script.Parent}
	params.FilterType = Enum.RaycastFilterType.Blacklist
	local raycastAttempt = workspace:Raycast(script.Parent["1"].Position, script.Parent["1"].Position + (Vector3.fromNormalId(Enum.NormalId.Bottom) * 10), params)
	if raycastAttempt then
		print("Raycast_Attempt: ",raycastAttempt.Position)
		print("Start_Point: ", script.Parent["1"].Position)
		print("Finish_Point: ",script.Parent["1"].Position + (Vector3.fromNormalId(Enum.NormalId.Bottom) * 10))
		local part ="Part")
		part.CFrame =
		part.Name = "Visualization"
		part.Size =,1,1)
		part.Anchored = true
		part.CanCollide = false
		part.Material = raycastAttempt.Material
		part.Color =,0,0)
		part.Parent = workspace

The second argument is a direction, not a position, relative to the origin of the ray cast. However you treated it as relative to the world origin (0, 0, 0).

So just do

workspace:Raycast(script.Parent["1"].Position,, -1, 0)*10, params)

I was stuck on this issue for about 2.5 hours now overthinking it. I’ll try not doing the same silly mistake next time.
Thank you for the help (:

And please click the “Solution” button on @incapaz’s post to mark this post as solved.

1 Like

Did it, thanks for reminding me. (: