There is indeed a smoother way to move NPCs along a map. There are two methods to do this. The first one is the best for you.
Using a Humanoid and Humanoid:MoveTo()
I apologize if I give any errors during this explanation, as I am working on learning this myself, but I understand how it mostly works.
First of all, you'd want to insert a humanoid into the NPC. This accesses Health, MaxHealth, WalkSpeed, JumpPower, etc. It is everything you would want to create an NPC. The best way to create one is to insert a rig, then adjust that rig, but with extra hard painful work, you could make a custom rig with more than R6 or R15 functions. Ensure it has a HumanoidRootPart and everything inside the humanoid is unanchored. You do not need to weld the humanoid together, but if anything is attached to it like a sword, you will need to weld it to the body part.
Then, you want to utilize the function "MoveTo()" which will move any humanoid that is able to and unanchored to a designated location. It even plays a smooth animation that either you made or Roblox gave you! MoveTo takes a vector3 value. It could also be a part's location!
Using the TweenService.
Now normally, if you just want to smoothly move a part along, you can just use part:TweenPosition(Vector3Value). However, there is a different way that it can be done by using the Tweening Service. It's hard to explain, so I will leave an example below.
01 | game.Players.LocalPlayer.PlayerGui:WaitForChild( "Dark" ) |
02 | local Darkness = game.Players.LocalPlayer.PlayerGui.Dark.Ness |
03 | local TweenService = game:GetService( "TweenService" ) |
04 | local Info 1 = TweenInfo.new( |
06 | Enum.EasingStyle.Quad, |
07 | Enum.EasingDirection.Out, |
18 | local Info 2 = TweenInfo.new( |
20 | Enum.EasingStyle.Quad, |
21 | Enum.EasingDirection.Out, |
31 | script.Parent.MouseButton 1 Click:Connect( function () |
32 | if Debounce = = false then |
34 | workspace.Selection:Play() |
35 | local Tween 1 = TweenService:Create(Darkness, Info 1 , goals 1 ) |
36 | local VolTween = TweenService:Create(workspace.MainTheme, Info 1 , Vgoals) |
39 | Tween 1. Completed:Wait() |
40 | workspace.MainTheme:Stop() |
42 | workspace.CurrentCamera.CFrame = workspace.CCC.CFrame |
43 | script.Parent.Parent.Parent.Enabled = false |
44 | game.Players.LocalPlayer.PlayerGui.CCC.Faction.Enabled = true |
45 | workspace.CCCTheme:Play() |
46 | local Tween 2 = TweenService:Create(Darkness, Info 2 , goals 2 ) |
48 | Tween 2. Completed:Wait() |
Like animations, the TweenService needs to be created, then played. If you need more help, the roblox developer wiki will have more information on the tweenservice and it's values.