My punch animations dont actually look the same.
https://gyazo.com/88e9bca468162c353b27ae8ac5f17f90 - GAME
My punch animations dont actually look the same.
https://gyazo.com/88e9bca468162c353b27ae8ac5f17f90 - GAME
well seems like they do?
if your talking about how it looks weird when the end, its cause the animations arent blending together, punch1 stops, then punch2 plays it seems
Thanks for your contribution, and forgive me for not specifying but what is wrong is that the first frames of the animation don’t seem to play.
can i see the code your using for the anim?
// MODULE
local CombatHandler = {
MeleeAnims = {
["L"] = animations.Punch1,
["LL"] = animations.Punch2,
["LLL"] = animations.Punch3,
["LLLL"] = animations.Punch4,
["LLLLL"] = animations.Punch1,
}
}
-- Animate function
function CombatHandler.getAnimation(Humanoid, sequence)
local length = .27 -- Cooldown per m1
local track = Humanoid.Animator:LoadAnimation(CombatHandler.MeleeAnims[sequence])
local keysequences = KeyProvider:GetKeyframeSequenceAsync(CombatHandler.MeleeAnims[sequence].AnimationId)
local keyframes = keysequences:GetKeyframes()
for i=1, #keyframes do
local Time = keyframes[i].Time
if Time > length then
length = Time
end
end
return Humanoid.Animator:LoadAnimation(CombatHandler.MeleeAnims[sequence]), length
end
// LOCAL
-- Variables and Services
local rp = game:GetService("ReplicatedStorage")
local uis = game:GetService("UserInputService")
local Debris = game:GetService("Debris")
local combat = rp.ClientToServer:WaitForChild("Combat")
local finalhit = rp.ClientToServer:WaitForChild("Finalhit")
local db = false
local cds =
{
0,
1
}
local sequence = ""
local curr = 0
local prev = 0
uis.InputBegan:Connect(function(input, isTyping)
if isTyping then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if db == false then
db = true
curr = os.clock()
local PT = curr - prev
if PT < 1 then
sequence = sequence.."L"
if string.len(sequence) > 5 then
sequence = "L"
end
else
sequence = "L"
end
combat:FireServer(sequence)
end
end
end)
combat.OnClientEvent:Connect(function(bool)
prev = curr
if bool then
wait(cds[2])
db = false
else
db = false
end
end)
// SERVER
-- // Variables and Services
local rp = game:GetService("ReplicatedStorage")
local combat = rp.ClientToServer:WaitForChild("Combat")
local CombatHandler = require(script.CombatHandler)
combat.OnServerEvent:Connect(function(player, sequence)
local character = player.Character
local humanoid = character.Humanoid
local humrp = character.HumanoidRootPart
local action, Length = CombatHandler.getAnimation(humanoid, sequence)
action.Priority = Enum.AnimationPriority.Action
action:Play()
action:GetMarkerReachedSignal("Hitbox"):Connect(function()
CombatHandler.createHitbox(player, character, humrp)
end)
wait(Length)
if string.len(sequence) < 5 then
combat:FireClient(player,false)
else
combat:FireClient(player,true)
end
end)
I think the error is probably on the server
your loading the anim on the server? you should be loading it on the client
Yeah, ill replicate the punch animation to all the clients but im fixing this first, the animations looks quite bad.
Try to disable animationweightblendfix from workspace
Not working, looks the same. 30chhhhharrrr
That’s because Roblox automatically makes the animations blend into each other. I would suggest you copy the first set of key frames of the animation onto the next 0.1 second (or however much you’ll like), then put the rest of the keyframes after that.
That seems to work perfectly! thank you.