#Help syncing run and walk animations with LinearVelocity

12 messages · Page 1 of 1 (latest)

pale kestrel
#

Anyone know how to use linear velocity, because whenever I do stuff like run and walk animations the running / walking arent synced with the walkspeed

Code:

local player = game.Players.LocalPlayer
local linearVelocity = script.Parent
local attachmentVelocity = script.Parent.Attachment

local humanoidRootPart = player.Character.HumanoidRootPart

attachmentVelocity.Parent = humanoidRootPart
linearVelocity.Parent = humanoidRootPart
linearVelocity.Attachment0 = attachmentVelocity

game:GetService("RunService").Stepped:Connect(function()
    for i,v in pairs(player.Character.Humanoid:GetPlayingAnimationTracks()) do
        if v.Name == "run" then
            if v.IsPlaying then
                
                linearVelocity.MaxForce = 1e9
                linearVelocity.VectorVelocity = humanoidRootPart.CFrame.lookVector * 16
                
            end

        elseif v.Name == "walk" then
            if v.IsPlaying then
                
                linearVelocity.MaxForce = 1e8
                linearVelocity.VectorVelocity = humanoidRootPart.CFrame.lookVector * 16

            end
        end
    end
end)```
blazing lotus
pale kestrel
#

Im using the R15 Animate script for this btw

blazing lotus
#

like determines the position of the model

pale kestrel
#

i didnt actually create these animations these are from yakuza, is there anyway around this?

blazing lotus
#

Yeah...that might be the problem is that they animated it very diffrently, and probably made it non-stationary for some reason

#

I don't actually know how to deal with those files, so sorry.

pale kestrel
#

will linear velocity help resync it?

#

if I change walkspeed it makes the unsynced animations even faster

blazing lotus
#

I think it might be some internal roblox thing where it's supposed to help, but here it is not helping