Start of Animation gets clipped off (studio and game animation differ)

I’m trying to make a sitting animation

The only issue is that the animation doesn’t start at the begging of the anmatino and starts a few milliseconds before it should so it looks like it teleports.

I haven’t tried a whole lot since i didn’t know where to start looking to fix so I was hoping someone would know how to help

Video Showcase

Code

-- This is a serverscript event
	local Character = plr.Character
	Character.Archivable = true
	local Clone = Character:Clone()
	Clone.Parent = Scene
	Clone.HumanoidRootPart.CFrame = Hpos

	local hum = Clone:WaitForChild("Humanoid")
	local anim = Instance.new("Animation")
	anim.AnimationId = "rbxassetid://18296936940"
	anim.Parent = hum
	
	local loop = Instance.new("Animation")
	loop.AnimationId = "rbxassetid://18297426017"
	loop.Parent = hum
	
	wait()
	local animationTrack = hum:LoadAnimation(anim)
	animationTrack:Play()
	local LoopTrack = hum:LoadAnimation(loop)
	LoopTrack:Play()
	LoopTrack.Looped = true

Any help would be appreciated

1 Like

remove wait() -------------------------------------------

that didn’t change anything –

I’m a little confused, what is anim and what is loop? Do you want anim to play before loop and have loop only start when anim has ended?

yea sorry I worded that badly I was in a rush.
But to explain the code. anim is the walk up animation that is initially played and the loop is a loop animation of the player sitting down (this is so the character stays still after the walkup animation) the loop animation only plays after the walk up animation so that it all moves smoothly. hope this helps,

and while I’m still at is i might as well post my solution.

I just forgot to pre anchor the character before the animation.
Clone.HumanoidRootPart.Anchored = true

1 Like

Well, if you want to have your code wait until one animation is finished playing before starting another, you can use the .StoppedEvent:

anim1:Play()
anim1.Stopped:Wait()
-- anim2 will only play once anim1 finishes
anim2:Play()

I tried this before, it didn’t work as planned, took a split second for the animation to switch so it reset to its original pos which made it look really bad since the starting frame was pretty far away from the end frame

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.