I need help in changing default animations in game. The thing is, I have a walking animation and a running animation. But when I try to go ahead and run, the run animation just doesn’t work???
Here’s a video (run script is from a different place):
VIDEO:
How do I make it change BASED on speed? And how do I change the fade in and out of each animation?
P.S.I don’t want to put the animation with the run script, cause that’ll just override the animations, and it’ll look pretty funky.
local Players = game:GetService("Players")
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
playingTracks:Stop(0)
end
local animateScript = character:WaitForChild("Animate")
animateScript.run.RunAnim.AnimationId = "rbxassetid://11209207590" -- Run
animateScript.runBack.RunBackAnim.AnimationId = "rbxassetid://11209207590" -- Run
animateScript.runBackwardLeft.RunBackwardLeftAnim.AnimationId = "rbxassetid://11209207590" -- Run
animateScript.runBackwardRight.RunBackwardRightAnim.AnimationId = "rbxassetid://11209207590" -- Run
animateScript.runForwardLeft.RunForwardLeftAnim.AnimationId = "rbxassetid://11209207590" -- Run
animateScript.runForwardRight.RunForwardRightAnim.AnimationId = "rbxassetid://11209207590" -- Run
animateScript.runLeft.RunLeftAnim.AnimationId = "rbxassetid://11209207590" -- Run
animateScript.runLeft2.RunLeft2Anim.AnimationId = "rbxassetid://11209207590" -- Run
animateScript.runRight.RunRightAnim.AnimationId = "rbxassetid://11209207590" -- Run
animateScript.runRight2.RunRight2Anim.AnimationId = "rbxassetid://11209207590" -- Run
end
local function onPlayerAdded(player)
player.CharacterAppearanceLoaded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)
No, no, you don’t understand, maybe? I’m trying to make the character RUN when I SPRINT, but it only plays the WALKING animation. I want it to not have that to happen
Sorry if this comes out rude but I’m just stuck with this problem for a couple hours now.
This is what I’ve come up so far, the run works but the walking just doesn’t.
function onRunning(speed)
if speed >= 8 then
playAnimation("run", 0.5, Humanoid)
pose = "Running"
else
if emoteNames[currentAnim] == nil then
playAnimation("idle", 0.5, Humanoid)
pose = "Standing"
end
end
if speed <= 6 then
playAnimation("walk", 0.1, Humanoid)
pose = "Walking"
end
end