for waypoint=1, #waypoints:GetChildren() do
wait(0.1)
print(waypoint)
local tweenInfo = TweenInfo.new(Time, Enum.EasingStyle.Linear,Enum.EasingDirection.Out, 0, false, 0)
mob.MovingTo.Value = waypoint
local MobTween = TweenService:Create(mob.HumanoidRootPart, tweenInfo, {CFrame = CFrame.new(waypoints[waypoint].Position)})
if mob.Humanoid.WalkSpeed <= 0 then
repeat MobTween:Cancel()
until mob.Humanoid.WalkSpeed > 0
else
repeat MobTween:Play()
mob.HumanoidRootPart.CFrame = CFrame.lookAt(mob.HumanoidRootPart.Position, waypoints[mob.MovingTo.Value].Position)
until MobTween.Completed:Wait()
end
end
mob:Destroy()
Map.Base.Humanoid:TakeDamage(humanoid.Health)
end)
the auto rotate feature with a humanoid is your best bet here. the tween you are using right now just does position not rotating. a humanoid also has a MoveTo function which will be easier than using tweens. if you don’t want the name/health to show just change the ViewerType to None. using a humanoid over a tween and CFrame is much better
Down below, you are changing the CFrame to the CFrame of the waypoint. (Part)
Since the part FrontFace is facing down, the HumanoidRootPart of the Zombie model is rotating to get the same Orientation has the part’s FrontFace.
To fix this, change the waypoint Orientation property to the same Orientation as the HumanoidRootPart of the Zombie.
Edit :
Don’t forget to mark this as the Solution if this fixed the problem.