I’m trying to make a silly creature peek around a corner and go away when you go close, but the animation is ending early resulting in the silly dubious creature disapearing earlier, witch looks a bit weird.
Video of what happens:
Code:
local hum = script.Parent:FindFirstChildOfClass("Humanoid")
local peekanim = hum:LoadAnimation(script:WaitForChild("Peek"))
local trigger = script:WaitForChild("Trigger")
peekanim.Looped = true
peekanim:Play()
local deb = false
trigger.Touched:Connect(function(hit)
if deb == false then
if game.Players:GetPlayerFromCharacter(hit.Parent) then
deb = true
trigger:Destroy()
local walkawayanim = hum:LoadAnimation(script:WaitForChild("WalkAway"))
walkawayanim:Play()
walkawayanim.Ended:Wait()
script.Parent.Parent = game.ServerStorage
end
end
end)
It seems like the issue might be with the animation itself, but there could be a simple workaround. You can try adding a number between the parentheses when playing the animation to smooth the animation weight, resulting in less harsh playbacks at the start.
it’s roblox fault, its pretty much unfixable (i think), but if you do it in-game it’ll load a lil-bit properly, but you can preload the animation What is the best way to preload all assets?