G’day people!
I’m making an survival game about postap and i need to make mutants for that. The mutants uses custom character, mesh that was rigged in blender and animated in roblox with pluging “Animation Editor”. When i put animation simply on character without walking script, that works perfectly:
But when i put it on NPC which is walking to me, animation is glitching:
- If make animation constantly, so when NPC isnt walking the animation works good, but when NPC start move - animation broke.
Script for using animation
local h = script.Parent.Humanoid
local a = h:LoadAnimation(script:FindFirstChildOfClass("Animation"))
function isrun()
--while script.Parent:FindFirstChild("Humanoid") ~= nil do
if h.MoveDirection.Magnitude > 0 then
a.Looped = true
a:Play()
end
if h.MoveDirection.Magnitude == 0 then
a:Stop()
end
wait(3)
--end
end
game:GetService("RunService").Heartbeat:Connect(isrun)
Hierarchy of character:
Where is mistake? I tried to find topics with the same problem on devforum, yt or google, but i didnt found the same problem and all of the topics was about standart R6 or R15 character.
P.S. I’m ugly scripter so there would be problems, i’m sure.