i’m working on an april fool’s update for my game and i added an npc that mimicks your exact movements but there’s simply not enough frames to make it smooth. i wanna avoid tweening because while it does look funny it also looks really weird. also this is running on the client
local plr = game.Players.LocalPlayer
local chr = plr.Character or plr.CharacterAdded:Wait()
local brian = workspace.MovingBrian
local movements = {}
game:GetService("RunService").Stepped:ConnectParallel(function() --idk if there's any benefit in this case
table.insert(movements, chr.HumanoidRootPart.CFrame)
end)
game:GetService("RunService").Heartbeat:Connect(function()
brian:PivotTo(movements[1])
task.wait(0.5)
table.remove(movements, 1)
end)
did this and nothing happened, is this right? also it’s a mesh so maybe that’s why it doesn’t work? also tried using 0.5 for the 2nd argument. i’ve never used Lerp before so i’m sorry if i’m stupid
Is this NPC supposed to move exactly to where your player is, even if the player is standing still?
In that case you could try making the NPC Parts CanCollide false so it doesn’t bump into you.
Otherwise you should offset the NPC’s Position a few studs away from the player’s RootPart.
Unless I’m missing something you haven’t explained yet.
My original question was due to the fact that you seem to be doing it like this:
Every Stepped you are putting this information into the table
Every Heartbeat you move the player (PivotTo)
1/2 second later you are removing the information from the table that has already been changed each Stepped from the first function.
It just seems weird to me that you aren’t doing these in one function.
(Sorry for video quality)
Here are the results I got with this:
local plr = game.Players.LocalPlayer
local chr = plr.Character or plr.CharacterAdded:Wait()
local brian = workspace.MovingBrian
game:GetService("RunService").Heartbeat:Connect(function(dt)
brian.PrimaryPart.CFrame = brian.PrimaryPart.CFrame:Lerp(chr.PrimaryPart.CFrame, dt)
end)
And an anchored HumanoidRootPart for moving brian. Might not be what u want because it’s pretty identical to tween service.
Also you can multiply dt to increase the speed of the lerp