#Run Animation Freezes
1 messages · Page 1 of 1 (latest)
here is the code:
local replicatedStorage = game:GetService("ReplicatedStorage")
local runService = game:GetService("RunService")
local movementEventsFolder = replicatedStorage:FindFirstChild("Events"):FindFirstChild("Movement")
local animationsFolder = replicatedStorage:FindFirstChild("Animations")
local Animations = animationsFolder:FindFirstChild("Movement")
-------------------------------------------------------------------------------------------
local isCrouching = false
local isSprinting = false
-------------------------------------------------------------------------------------------
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
if not animator then
animator = Instance.new("Animator")
animator.Parent = humanoid
end
-------------------------------------------------------------------------------------------
local crouchIdleAnimation = Animations:FindFirstChild("CrouchIdle")
local crouchWalkAnimation = Animations:FindFirstChild("CrouchWalk")
local sprintAnimation = Animations:FindFirstChild("Sprint")
local crouchIdleTrack = animator:LoadAnimation(crouchIdleAnimation)
local crouchWalkTrack = animator:LoadAnimation(crouchWalkAnimation)
local SprintTrack = animator:LoadAnimation(sprintAnimation)