--				if Zdir < 0 then -- Get closest 45 degree angle. Diagonal.
--					Zdag = -RAYLength
--				else
--					Zdag = RAYLength
--				end
--				if Xdir < 0 then
--					Xdag = -RAYLength
--				else
--					Xdag = RAYLength
--				end


				if math.abs(Xdir) > math.abs(Zdir) then  -- Ordinal.
					if Xdir < 0 then 
						Xdir = -RAYLength          
						-- convert to our direction indicator.  
					else
						Xdir = RAYLength
					end
					Zdag = Xdir -- Diagonal Right.
					Xdag = Xdir
					Zdir = 0
				else   -- abs
					if Zdir < 0 then
						Zdir = -RAYLength	
					else                                  
						Zdir = RAYLength
					end
					Zdag = Zdir
					Xdag = -Zdir
					Xdir = 0 
				end  -- abs
end -- GetDir


while AItorso do -- while I still have a body; search.
torsoPos = AItorso.Position
local targ = Workspace.Terrain  -- Temp targ
local Distance =(torsoPos - OldPos).magnitude -- Distance traveled, since last loop