Normally I would just set the CFrame in a while loop.
while wait() do local direction = (plr.Character.Torso.Position - bot.Torso.Position) * Vector3.new(1, 0, 1) bot.Torso.CFrame = CFrame.new(bot.Torso.Position, bot.Torso.Position + direction) end
But I want to decrease lag, so I started trying to use a body gyro.
local gyro = Instance.new("BodyGyro",bot.Torso) gyro.D = 0 gyro.P = 9999 gyro.cframe = plr.Character.Torso.CFrame
Unfortunately it doesn't work at all -- the bot doesn't rotate. AutoRotate is disabled. Nothing is erroring in the output.
All variables are defined.
This is probably inefficient but it should work. If it does not work it is most likely due to welds or anchoring.
while wait(0) do gyro.cframe = CFrame.new(bot.Torso.Position,plr.Character.Torso.Position) - bot.Torso.Position end