I’m trying to achieve a NPC roaming around a player in 360 degrees. In the picture shown, the first direction and the second direction are unrelated and the second always starts there. I wanted it to relate to the first direction, but it always does not. Any help will be appreciated!
This is the code
if pos == nil then
pos = plrHRP.Position + (dir * 50)
inidir = dir
else
local radi = math.rad(cDegree)
local rotation = CFrame.Angles(0,radi,0)
local direction = (rotation * CFrame.new(inidir)).LookVector
pos = plrHRP.Position + (direction * 50)
if cDegree == 355 then cDegree = 0 else cDegree += 5 end
end
I’ve deleted the code that creates the part.