#Animation Help

1 messages · Page 1 of 1 (latest)

young dune
#
local UIS = game:GetService("UserInputService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer

local KEY = Enum.KeyCode.Q
local DASH_SPEED = 80
local DASH_TIME = 0.25
local COOLDOWN = 0.8

local canDash = true
local dashTrack

local function setupCharacter(char)
    local humanoid = char:WaitForChild("Humanoid")
    local root = char:WaitForChild("HumanoidRootPart")

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

    local dashAnim = Instance.new("Animation")
    dashAnim.AnimationId = "rbxassetid://99270118563050"

    dashTrack = animator:LoadAnimation(dashAnim)
    dashTrack.Priority = Enum.AnimationPriority.Action

    local function dash()
        if not canDash then return end
        canDash = false

        dashTrack:Play()

        local att = Instance.new("Attachment", root)

        local lv = Instance.new("LinearVelocity")
        lv.Attachment0 = att
        lv.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
        lv.MaxForce = math.huge
        lv.VectorVelocity = root.CFrame.LookVector * DASH_SPEED
        lv.Parent = root

        task.wait(DASH_TIME)

        lv:Destroy()
        att:Destroy()
        dashTrack:Stop()

        task.wait(COOLDOWN)
        canDash = true
    end

    UIS.InputBegan:Connect(function(input, gp)
        if gp then return end
        if input.KeyCode == KEY then
            dash()
        end
    end)
end

player.CharacterAdded:Connect(setupCharacter)
if player.Character then
    setupCharacter(player.Character)
end

Any idea why this doesnt work?

brazen marten
#

no

young dune
#

Me too

brazen marten
#

u didnt post any errors

cerulean onyx
#

Any errors?

brazen marten
#

or say whats wrong

#

so idk

young dune
#

The animation doesnt play and i dont get any errors back

cerulean onyx
#

This seems very ai code to me😭

young dune
#

yeah cuz i tried making it myself it didnt work and i tried this way

cerulean onyx
#

Why is there so much useless stuff in there

cerulean onyx
#

With the help of ai maybe and with roblox docs/ youtube tutorials

young dune
#

i tried them nothing worked

cerulean onyx
#

Can't help then

#

gl

young dune
#
--                        Enjoy This Ability

local UIS = game:GetService("UserInputService")
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()

local slideAnim = Instance.new("Animation")
slideAnim.AnimationId = "rbxassetid://76875231427886"

local keybind = Enum.KeyCode.Q-- between the key for ability
local canslide = true

local animator = char:FindFirstChildOfClass("Animator")
if not animator then
    animator = Instance.new("Animator")
    animator.Parent = char
end

UIS.InputBegan:Connect(function(input,gameprocessed)
    if gameprocessed then return end
    if not canslide then return end
    
    if input.KeyCode == keybind then
        canslide = false
        
        local playAnim = char.Humanoid:LoadAnimation(slideAnim)
        playAnim:Play()
        
        local slide = Instance.new("BodyVelocity")
        slide.MaxForce = Vector3.new(1,0,1) * 30000
        slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * 100
        slide.Parent = char.HumanoidRootPart
        
        for count = 1, 8 do
            wait(0.05)
            slide.Velocity*= 0.7
        end
        playAnim:Stop()
        slide:Destroy()
        canslide = true
    end
end)
#

at least tell me if its good

cerulean onyx
#

Another copy psste😭

young dune
#

its a toolbox thing

tight cipher
#
local slideAnim = Instance.new("Animation")
slideAnim.AnimationId = "rbxassetid://76875231427886"
#

this part

#

because you can only use animations you have ownership of

#

so if you just pasted it in

#

thats why ur animation isnt working

young dune
tight cipher
#

It might also be ur animator

#

well no

#

Put a print statement like so, see if it prints properly

if input.KeyCode == keybind then
  print("printing!")
#

and there are no errors correct?

quick gust
#

yo im sure NO ONE wants to debug ai slop for ya. debug takes time and effort, so it's a form of labor. You should be grateful people are willing to look for issues in code in the first place. Pulling up with ai slop, however, is SO disrespectful. it really shows you just want everything handed to you on a silver platter.

tight cipher
#

rude

quick gust
#

its not rude its honest

#

you don't ask people for free art either

tight cipher
#

even before AI, there were people who just copy pasted code and didnt know what was going on. Even then people still berated people for not putting enough effort in

#

its not disrespectful

#

this is gatekeeping

#

I couldve ignored this because he used AI

#

i didn't, and if he doesnt feel like putting in the effort to try my solutions and learn from my comments

#

thats on him

quick gust
#

You do know people don't learn from ai, right? They input a prompt, generate their code, don't understand the ai generated code, so they pass it here for you guys to debug their generations

whole orchidBOT
#

studio** You are now Level 1! **studio

tight cipher
#

i copy pasted hella code when I first started

#

but, I would hope not for my questions to be dismissed purely on the fact it was copy pasted.

#

when I provide explanations I dont just give code, I comment on the reason for the happening

#

some people have the drive to learn and move forward

#

some people dont

quick gust
#

True

#

Sorry

#

I'm just kind of tired of all the ai bullshit I guess

#

Harms more than it helps when trying to script inmany other lamguages imo

tight cipher
#

AI is very harmful to the learning process I agree, but I think it will just raise the bar for actually qualified developers