#Animation not working

1 messages · Page 1 of 1 (latest)

vast girder
#
local player = game.Players.LocalPlayer 
local RS = game:GetService("ReplicatedStorage")

local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local root = character:WaitForChild("HumanoidRootPart")
local dashAnim = RS:WaitForChild("DashAnimation")

local DashCD = false

local animator = humanoid:FindFirstChildOfClass("Animator")
if not animator then
    animator = Instance.new("Animator")
    animator.Parent = humanoid
end
local dashTrack = animator:LoadAnimation(dashAnim)


uis.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end 

    if input.KeyCode == Enum.KeyCode.Q and not DashCD then
        DashCD = true
        dashTrack:Play()

        local dash = Instance.new("BodyVelocity")
        dash.MaxForce = Vector3.new(1, 0, 1) * 30000
        dash.Velocity = root.CFrame.LookVector * 100
        dash.Parent = root
        

        game.Debris:AddItem(dash, 0.3)

        task.wait(1)
        DashCD = false
    end
end)

this is my code i have DashAnimation as an animation in RS with the ID in it but it wont load. This has happened like 3 other times when i tried to code sliding and jumping animations just wont load i tried getting help from the BIG GPT but he cant help either anyone know? this script is local script in starter character scripts if that matters

frosty ivy