I am trying to make it where a character looks at a player but when I try the code it only changes position once instead of it repeating changes to look at the player doe’s anyone know a fix?
the condition you are using returns a number which casts to true in the until statement, resulting in it only running for 1 iteration. Instead track the total time in a variable and break out of the loop when necessary. task.wait(x) returns the time actually waited by the function, since it can vary abit.
local totalTime = 0
while totalTime < 3 do
-- change cframe
totalTime += task.wait()
end
I tried this but then the NPC started to drag but it did work!