local hum = script.Parent.Humanoid
local humRootPart = hum.Parent.HumanoidRootPart
humRootPart:SetNetworkOwner(nil)
local idle = script.LoadingScreen_Idle
local idleAnimTrack = hum.Animator:LoadAnimation(idle)
local idleAudio = script.Parent.Head.Breathing
idleAnimTrack:Play()
idleAudio:Play()
function ChangeAnimation(animation)
if (animation == nil) then
print(“No Animation Found”)
else
local anim = animation
local animTrack = hum.Animator:LoadAnimation(anim)
animTrack:Play()
end
end
script.Parent.InputBegan:Connect(function(inputObject, gameProcessedEvent)
if (inputObject.KeyCode == Enum.KeyCode.E) then
local spin = script.Spin
ChangeAnimation(spin)
end
end)
script.Parent.InputBegan:Connect(function(inputObject, gameProcessedEvent)
if (inputObject.KeyCode == Enum.KeyCode.RightControl) then
local punch = script.Punch
ChangeAnimation(punch)
end
end)
script.Parent.InputBegan:Connect(function(inputObject, gameProcessedEvent)
if (inputObject.KeyCode == Enum.KeyCode.RightShift) then
local kick = script.Kick
ChangeAnimation(kick)
end
end)
script.Parent.InputBegan:Connect(function(inputObject, gameProcessedEvent)
if (inputObject.KeyCode == Enum.KeyCode.W) then
local walking = script.Walking
ChangeAnimation(walking)
end
end)
script.Parent.InputBegan:Connect(function(inputObject, gameProcessedEvent)
if (inputObject.KeyCode == Enum.KeyCode.S) then
local walking = script.Walking
ChangeAnimation(walking)
end
end)
script.Parent.InputBegan:Connect(function(inputObject, gameProcessedEvent)
if (inputObject.KeyCode == Enum.KeyCode.A) then
local walking = script.Walking
ChangeAnimation(walking)
end
end)
script.Parent.InputBegan:Connect(function(inputObject, gameProcessedEvent)
if (inputObject.KeyCode == Enum.KeyCode.D) then
local walking = script.Walking
ChangeAnimation(walking)
end
end)
I have used a similar animation system. I had trouble with the punch and kick as well. I found it to be a problem with the animation itself, or something about the way it was created in the animation builder. I would try re-animating the punch and kick. You can also try putting a wait(time) between the punch and kick animations. The key is to make sure the animations do not overlap.
Sorry, should’ve added this into the topic, the animation is being used by a Pathfinding AI, other animations work on the model, just not that one for some reason.