Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Simple Animation Problem: Animation cuts out?

Asked by 6 years ago

Problem with animation: https://gyazo.com/9a545dd2e13f8e2054e24cadbbb9bf1a

I made an animation that plays whenever the player runs while wielding the sword with the script below. It kind of works -- as seen by the link above -- however it gets cut off a lot. I've tried some different things such as:

-- Changing the priority(I tried every single one)

-- Disabling the "Animate" Script in the character

-- Changing the duration of the animation

-- Using a remote function(As seen in my current script)

-- Reading the Wikia

What else can I do? I was thinking of replacing the default Roblox run animation when the weapon is equipped but I read on the Wikia that it doesn't work anymore.

Server script inside sword(Part of the script):

local repStorage = game:GetService("ReplicatedStorage")
function Equipped()
    Character = Tool.Parent
    Player = Players:GetPlayerFromCharacter(Character)
    Humanoid = Character:FindFirstChild("Humanoid")
    RootPart = Character:FindFirstChild("HumanoidRootPart")
    if not CheckIfAlive() then
        return
    end
    ToolEquipped = true
    Humanoid.Running:Connect(function() 
        local a = repStorage:WaitForChild("PlayAnim")
        a:FireServer()
    end)
end

Tool.Equipped:connect(Equipped)

Server Script in ServerScriptService:

local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:WaitForChild("PlayAnim")

--//Remote Event//--
remote.OnServerEvent:Connect(function(player)
    local run = player.Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Anim.SwordRun)
    run:Play()          
end)
0
Is the animation looped? magicguy78942 238 — 6y
0
@magicguy78942 I couldn't find a "loop" button on the new Roblox Animation UI secretboy6 68 — 6y
0
I found an animation plugin with the "loop" option. This is what happened after the loop: https://gyazo.com/cf085f86799915e1e222a8e0e87e0e28 secretboy6 68 — 6y

1 answer

Log in to vote
0
Answered by
PlaasBoer 275 Moderation Voter
6 years ago

Okay so the Humanoid.Running event gets fired every time the player starts to run or stop try it out to see what happens add a printinside the Humanoid.Running event.What I suggest you do is try to replace the run anim and walk with your animation it is in side the character.Animate.walk but also change the run

Read more on Humanoid.Running https://wiki.roblox.com/index.php?title=API:Class/Humanoid/Running

Ad

Answer this question