How do I update this raycasting method

How would I update this script I found to the updated raycasting method on mobile for my own use thanks.

‘’'uis.TouchTapInWorld:Connect(function(position, processed)

local ray = camera:ViewportPointToRay(position.X, position.Y, 0)


ray = Ray.new(ray.Origin, ray.Direction * 500)

	local target, point, surface = workspace:FindPartOnRayWithIgnoreList(ray, filter)
print(target)

end’‘’.