How could i make dummy walk smoothly?

Hello everyone!

So i’m making a horror game with monsters, and rigs are moving kinda too sharply, including the players.
To fix this i found a code that gets move vector from player module and makes player move smoothly, but the problem is that i couldn’t edit this script like that so it works on server script with rig (not player).

Here is script (that is currently works on client side only with player, i don’t know with what i should change the variables so it works on server):

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local camera = game.Workspace.CurrentCamera
local RunS = game:GetService("RunService")

local targetMoveVelocity = Vector3.new()
local moveVelocity = Vector3.new()
local moveAcceleration = character:WaitForChild("Humanoid"):GetAttribute("MoveAcceleration")

local function lerp(a, b, t) return a + (b - a) * t end

local function getWalkDirectionCameraSpace()
	local walkDir = require(plr:WaitForChild("PlayerScripts").PlayerModule:WaitForChild("ControlModule")):GetMoveVector()

	if walkDir.Magnitude > 0 then
		walkDir = walkDir.Unit
	end

	return walkDir
end

local function getWalkDirectionWorldSpace()
	local walkDir = camera.CFrame:VectorToWorldSpace(getWalkDirectionCameraSpace())
	walkDir *= Vector3.new(1, 0, 1) --Set Y axis to 0

	if walkDir.Magnitude > 0 then
		walkDir = walkDir.Unit
	end

	return walkDir
end

local function updateMovement(dt)
	moveAcceleration = character:WaitForChild("Humanoid"):GetAttribute("MoveAcceleration")
	local humanoid = character:FindFirstChild("Humanoid")
	local HRP = character:FindFirstChild("HumanoidRootPart")
	if humanoid then

		

		local moveDir = getWalkDirectionWorldSpace()
		targetMoveVelocity = moveDir
		moveVelocity = lerp(moveVelocity, targetMoveVelocity, math.clamp(dt * moveAcceleration, 0, 1))
		humanoid:Move(moveVelocity)
	end
end	

RunS.RenderStepped:Connect(updateMovement)

Every time i tried to find a script that would make dummy walk smoothly it would just give me how to make dummy turn smoothly or just begginer tutorial how to make dummy walk.

I want dummy to slowly accelerate when he starts walking and slowly decelerate when he stops and the speed would depend on the moveAccelerating variable, and no i don’t want just to change walkspeed beacuse when dummy would already accelerate go other direction he would do it instantly (not smooth).

Dummy should turn other directions smoothly too.

Can somebody help me please?

Can you show a video of what it looks like currently?

NPC should move just like my character on that video:

The script i used to achieve that effect on player character i showed in my post, but i’m trying to figure out how to make it work on server script with NPC.

When i tried to edit that script for NPC there was few things that happened: character just couldn’t turn at all, or he was just going crazy like shaking or something

Try changing the network owner of the model to nil. Maybe that will help

What does network owner do? I were testing dummy movement with Play but Run button. (it runs server without players) So i don’t know if it will affect him somehow.

On the video i used Play button so i can show on players how they should move, every other time i used Run button to test dummies

try using CustomPhysicalProperties maybe?

tinker with friction a bit, i think that should do it