You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I want my humanoid to walk seamlessly to each destination (in this case, spots on a game board; I’m making my own version of Monopoly).
-
What is the issue? The humanoid seems to pause after it reaches each space.
The examples of “intended behavior” and “actual behavior” are virtually identical:
- The walk itself is fired from a
BindableEvent
. - The code runs on the server.
- The destination blocks are models with
PrimaryPart
set to the specific part the Humanoid should approach. - Right now, it’s set up so that when the Humanoid reaches its destination, it simply fires the event again and continues walking.
Here is the code I’m using in the “intended behavior” example, which doesn’t “stutter”:
local Event = game:GetService("ReplicatedStorage").Walk
local Pos = 0
task.wait(10) -- to give me time to watch from the server side
Event.Event:Connect(function()
local Humanoid = game.Workspace.Noob.Humanoid -- test subject
local Board = game.Workspace.Board1
Pos += 1
Humanoid:MoveTo(Board:FindFirstChild(tostring(Pos)).PrimaryPart.Position)
Humanoid.MoveToFinished:Once(function()
Event:Fire()
end)
end)
Event:Fire()
Here is all the code I’m using in the “actual behavior” example, which does “stutter” (there was originally more but I’ve remarked all but this and modified it too to more closely match the “intended behavior” example):
local Pos = 0
be.MovePlayer.Event:Connect(function(main,remaining) -- "be" = game:GetService("ReplicatedStorage").BindableEvents
local Humanoid = game.Workspace.average_wolfie.Humanoid
-- It doesn't matter which Humanoid is walking so I'm just testing mine here.
Pos += 1
local Board = game.Workspace.Board1
Humanoid:MoveTo(Board[tostring(Pos)].PrimaryPart.Position)
Humanoid.MoveToFinished:Once(function()
be.MovePlayer:Fire(main,remaining)
end)
end)
re.MovePlayer.OnServerEvent:Connect(function(player) -- "re" = game:GetService("ReplicatedStorage").RemoteEvents
be.MovePlayer:Fire(mm.FetchGame(player.Host.Value))
end)
-
What solutions have you tried so far? I thought it had something to do with me using
FindFirstChild()
for a few of the lines, but changing this had no effect. I have much more code that runs but I’ve bared it down to what I believe is the absolute minimum I need to walk the player in this scenario, and it still happens. I also recall attempting to useHumanoid:WalkTo()
on a LocalScript and it didn’t “stutter”.