so im trying to make a part be like a npc, and rn im making the movement. So ive already make it so it can move forward using tween but it just keeps going through the walls (he has a closed house) so how do i fix that?
here is the script:
local part = script.Parent
while true do
local distance = 10 local tween = game:GetService("TweenService"):Create(part, TweenInfo.new(1, Enum.EasingStyle.Linear), {CFrame = part.CFrame + (part.CFrame.LookVector * distance)})
tween:Play() wait(4) end