I Need Make AI Line With Enemy

Hi forum,
Some time ago I came with idea to make a Strategy game with view from the side;
I made Units (those who you calling on the battle field) and Enemy AI (zombies, and other guys which are spawning step by step).

So I need to make Unit line with Enemy, so Unit could atttack the Enemy, and well, I don’t really know how to realize it with Humanoid:MoveTo()

Could you please help me with that?

nvm, I just randomly coded the line with target function and it actually worked
the code:

Actions.LineWith = function(Target: BasePart)	if not Target then	return	end	local CurrentPosition = RootPart.Position	local TargetPosition = Target.Position	local Distant = CurrentPosition - TargetPosition	Humanoid:MoveTo(RootPart.Position + (Vector3.new(0, 0, -Distant.Z)))	Humanoid.MoveToFinished:Once(function(Reached)	if Reached ~= false then	local CheckCast = workspace:Raycast(RootPart.Position, RootPart.Position * 500, Params)	if CheckCast and CheckCast.Instance and CheckCast.Instance:IsDescendantOf(Target.Parent) then	return	end	end	end)	end 

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.