Now, before you say, “Check other topics for the solution!”, hear me out.
I have looked through so many youtube tutorials on how to do this, and I have looked through roblox topics, and no matter what I do, the animations just don’t work.
The steps I am following;
Play the game and copy the Animate local script from the player’s character,
paste it into the StarterCharacterScripts,
change the RunAnim AnimationId to 115845223351509 and WalkAnim Animation Id to 93681090384779.
(It’s a group game, and I uploaded both animations to the group)
It’s an R15 animation and the character spawns in as R15.
What am I doing wrong?
local Player = game:GetService("Players").LocalPlayer
local Character = workspace:WaitForChild(Player.Name)
local AnimateScript = Character:FindFirstChild("Animate")
if AnimateScript then
AnimateScript:Destroy()
end
local Humanoid = Character:WaitForChild('Humanoid')
local RunID = 88867726336340
local WalkID = 137599098519961
--local IdleID = 123952796982267
--local JumpID = 140408712765788
local RunningSpeed = 20
local NormalSpeed = 14
local FieldOfView = 80
local key = "LeftShift"
local RunAnimation = Instance.new('Animation')
RunAnimation.AnimationId = 'rbxassetid://'..RunID
local WalkAnimation = Instance.new('Animation')
WalkAnimation.AnimationId = 'rbxassetid://'..WalkID
--local IdleAnimation = Instance.new('Animation')
--IdleAnimation.AnimationId = 'rbxassetid://'..IdleID
--local JumpAnimation = Instance.new('Animation')
--JumpAnimation.AnimationId = 'rbxassetid://'..JumpID
local RAnimation = Humanoid:LoadAnimation(RunAnimation)
RAnimation.Priority = Enum.AnimationPriority.Movement
local WAnimation = Humanoid:LoadAnimation(WalkAnimation)
WAnimation.Priority = Enum.AnimationPriority.Idle
--local IAnimation = Humanoid:LoadAnimation(IdleAnimation)
--IAnimation.Priority = Enum.AnimationPriority.Core
--local JAnimation = Humanoid:LoadAnimation(JumpAnimation)
--JAnimation.Priority = Enum.AnimationPriority.Action
--JAnimation:AdjustSpeed(1.3)
Running = false
for i, v in pairs(Humanoid:GetPlayingAnimationTracks()) do
v:Stop()
end
local Info = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local Properties = {FieldOfView = FieldOfView}
local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera, Info, Properties)
local rProperties = {FieldOfView = 70}
local rInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local rT = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera, rInfo, rProperties)
function Handler(BindName, InputState)
if InputState == Enum.UserInputState.Begin and BindName == 'RunBind' then
Running = true
Humanoid.WalkSpeed = RunningSpeed
T:Play()
elseif InputState == Enum.UserInputState.End and BindName == 'RunBind' then
Running = false
if RAnimation.IsPlaying then
RAnimation:Stop()
end
Humanoid.WalkSpeed = NormalSpeed
rT:Play()
--if Humanoid.MoveDirection.Magnitude == 0 and not IAnimation.IsPlaying then
-- IAnimation:Play()
--end
end
end
Humanoid.Running:Connect(function(Speed)
if Speed >= 10 and Running and Humanoid.MoveDirection.Magnitude > 0 then
if not RAnimation.IsPlaying then
RAnimation:Play()
end
Humanoid.WalkSpeed = RunningSpeed
T:Play()
elseif Speed >= 10 and not Running then
if not WAnimation.IsPlaying then
WAnimation:Play()
end
Humanoid.WalkSpeed = NormalSpeed
rT:Play()
elseif Speed < 10 then
if RAnimation.IsPlaying then
RAnimation:Stop()
end
if WAnimation.IsPlaying then
WAnimation:Stop()
end
--if not IAnimation.IsPlaying then
-- IAnimation:Play()
--end
Humanoid.WalkSpeed = NormalSpeed
rT:Play()
end
end)
game:GetService('ContextActionService'):BindAction('RunBind', Handler, true, Enum.KeyCode[key])
Humanoid.StateChanged:Connect(function(oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
--JAnimation:Play()
end
end)
I commented all the stuff that I don’t think you’ll need (jump & idle) but if you want to use it ever its always there