Hey people
I’ve been struggeling with a problem for a while now.
My animation is being weird. Look for yourself
I don’t know why it’s so snappy the first time, then so good the second time.
-- check for beam hit, created when using beam. beam hit is in Humanoid
local remote = game:GetService("ReplicatedStorage"):WaitForChild("onBeamHit")
local NPChumanoid = script.Parent.Humanoid
local isBeamHit = false
local isPlaying = false
remote.OnServerEvent:Connect(function(player, humanoid)
if not isPlaying then
local beamHit = NPChumanoid:WaitForChild(player.Name.. " beamHitPart")
repeat wait() until NPChumanoid[player.Name.. " beamHitPart"]
if NPChumanoid:FindFirstChild(player.Name.. " beamHitPart") then
local animation = script:WaitForChild('goAir')
local humanoid = script.Parent:WaitForChild('Humanoid')
local goAir = humanoid:LoadAnimation(animation)
local animation = script:WaitForChild('onBeamHit')
local humanoid = script.Parent:WaitForChild('Humanoid')
local onBeamHit = humanoid:LoadAnimation(animation)
goAir:Play()
isPlaying = true
goAir.KeyframeReached:Connect(function(keyframe)
if keyframe == "startOther" then
goAir:AdjustSpeed(0)
onBeamHit:AdjustWeight(1)
onBeamHit:Play()
goAir.KeyframeReached:Connect(function(keyframe2)
if keyframe2 == "inAir" then
goAir:Stop()
end
end)
end
if humanoid.Health <= 0 then
isPlaying = false
onBeamHit:Stop()
end
end)
end
end
end)
I’ve tried anything i can think off.
Adjusting speed, weight, timing…
Sorry for if i have typos. It’s 2am lol.
Any ideas?
Thank you for reading