You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Have a character walk to a point with an animation
What is the issue? Include screenshots / videos if possible!
The character just hovers over to the point
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I haven’t found any solutions to try
script im using for the animation
local char = script.Parent
local human = char:FindFirstChild("Humanoid")
local unloaded = Instance.new("Animation", char)
unloaded.Name = "walk"
unloaded.AnimationId = "rbxassetid://14040782341"
local anim = human.Animator:LoadAnimation(unloaded)
human.Running:Connect(function(s)
if s > 0 then
if not anim.IsPlaying then
anim:Play()
end
else
if anim.IsPlaying then
anim:Stop()
end
end
end)
script im using to move the character
local char = game.Workspace.rusticbot
script.Parent.MouseClick:Connect(function()
char.Humanoid:MoveTo(script.Parent.Parent.Position)
end)
ive tested the animation as a player character (startercharacter whatever) and it works fine
Pair these scripts together and you should use a remote event to allow the character to move and play the animation at the same time. should look something like this
local animation = animationTrack
remoteEvent.OnServerEvent:Connect(function()
local animation2 = dummy:LoadAnimation(animation)
local dummy = workspace.Dummy
animation2:Play()
dummy.Humanoid:MoveTo(path)
-- whatever next, stop, idk up to u
end)
instead of making an animation script yourself you can copy your character’s animate script, insert it in the dummy, and replace the walking animation id with yours.
you’re using a button to make the character move. (You don’t have to its just my recommended way) and why are you using your own character to play the animation instead of the rusticbot.
local char = script.Parent -- your character
local human = char:FindFirstChild("Humanoid")
local char = game.Workspace.rusticbot -- not your character
here is a solution i did hello.rbxl (65.3 KB)
look what i did and it could probably help you out next time you have a problem like this again. (use your animation ID for the walk)
to restart its position, you can make a start point and when the animation is done, change the CFrame of the humanoid root part back to the starting point.