Making a player walk until an obstacle

Okay, I have tested and adjusted the directions, it works now!

However, My character is moving right into the obstacle and then walks after the wall for a few seconds because it’s getting blocked.
I tried multiplying the position by 0.5 but it leads to even weirder results.

for index, direction in informationTable do
		local dirFrame = module.findDirection(player, direction)
		if not dirFrame then break end 
		
		local params = RaycastParams.new()
		params.FilterDescendantsInstances = {character}
		params.FilterType = Enum.RaycastFilterType.Exclude
		
		local ray = workspace:Raycast(hrp.Position, dirFrame, params)
		if not ray then break end 
		
		humanoid:MoveTo(ray.Instance.Position)
		humanoid.MoveToFinished:Wait()
		
		warn(direction .. " done")
	end
	
	-- now check location if on winner pad and move on
	warn("Execution has finished, checking if win or sending loss to player.")