What I want to achieve: Animation to be smooth like it is in moon (see second attachment)
Issue: animation randomly becomes unsmooth (replicatable, the jitters happen on the exact same frames every time) - shown in video below
Attempted solutions: uploaded to moon animator & default roblox animation, reuploaded to roblox, which did not fix it. I haven’t found an answer in the forums yet.
More details:
the animation was animated in blender, all limbs including one called mastercontrol are animated.
this is what one part of the animation looks like when it’s played in moon animator, as you can see its perfectly smooth (same result is achieved when played in default animator or blender)
this is the exact code that runs the animation: (with added comments for clarification)
--creates mover constraints to fix the position and orientation of the player
local p = Effects:AlignPosition(char, rootcf.Position, 100000,30,1000)
local o = Effects:AlignOrientation(char, mousehit, 10000,100)
--sets the character's rootpart's cframe to face the right direction
char.HumanoidRootPart.CFrame = CFrame.new(rootcf.Position, mousehit.Position)
params.rootcf = char.HumanoidRootPart.CFrame
effectsremote:FireAllClients("Wind Ultimate", params)
--loads the casting animation
local anim = char:FindFirstChildWhichIsA("Animator", true):LoadAnimation(magicdata.Animations.UltStart)
anim:Play(0)
--same as task.wait
spellhandler:Startup("Wind Ultimate", player)
local damage = spellstats.BaseDamage * math.random(90,110)/100
--creates a hitbox and puts it in the right position, it has collisions OFF
local hitbox = hitboxmodule.new(spellid, player, EffectsFolder.Hitbox, CFrame.new(rootcf.Position, mousehit.Position))
local actual = hitbox.Hitbox
actual.Size = Vector3.new(actual.Size.X,actual.Size.Y,(rootcf.Position - mousehit.Position).Magnitude)
actual.Position += actual.CFrame.LookVector*actual.Size.Z/2
params.hitbox = actual
--tweens the character's rootpart's cframe to the end location of the hitbox and adjusts the mover constraint's position to that location as well.
local tween = ts:Create(char.HumanoidRootPart, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {CFrame = mousehit})
tween:Play()
p.Position = mousehit.Position
local function finish(hitchar)
-- this part can be ignored
spellhandler:Endlag("Wind Ultimate", player)
p:Destroy()
o:Destroy()
spellhandler:ApplyEffect("AutoRotate", true, spellid, char)
spellhandler:ApplyEffect("CanAttack", true, spellid, char)
spellhandler:ApplyEffect("CanMove", true, spellid, char)
spellhandler:ResetVelocity(0, char)
spellhandler:ResetVelocity(0, hitchar)
if hitchar then
hitchar.HumanoidRootPart.Anchored = false
end
end
local hit = false
hitbox:Enable(true,false)
hitbox.HitHum:Connect(function(hit)
--when a target is hit, cancel the mover tween, sets the movercontraint's position to the current position, and loads the cutscene animations.
local v = hit[1]
hit = true
tween:Cancel()
params.hitchar = v.Parent
DMGHandler:TakeDamage(char,v.Parent,damage,spellstats.Magic,variant)
p.Position = char.HumanoidRootPart.Position
local hitchar = v.Parent
-- sets the target's rootpart to the character's cframe and anchors it.
-- NOTE: ANCHORING THE CHARACTER'S ROOTPART DOES NOT FIX THIS PROBLEM
hitchar.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame
hitchar.HumanoidRootPart.Anchored = true
-- loads the hit animation and the cutscene animation
local anim = char:FindFirstChildWhichIsA("Animator",true):LoadAnimation(magicdata.Animations.UltHit)
local hitanim = hitchar:FindFirstChildWhichIsA("Animator",true):LoadAnimation(magicdata.Animations.UltVictim)
-- waits until both the animations are loaded and them plays them
while anim.Length == 0 and hitanim.Length == 0 do
task.wait()
end
anim:Play(0)
hitanim:Play(0)
effectsremote:FireAllClients("Wind Ultimate Hit", params)
anim:GetMarkerReachedSignal("Event"):Connect(function(event)
effectsremote:FireAllClients("Wind Ultimate "..event, params)
end)
task.wait(10) -- can be ignored
finish(hitchar)
end)
task.delay(0.3, function()
if hitbox.Enabled then
finish()
end
hitbox:Destroy()
end)
any help would be appreciated. thanks!