Weird animation issue

This is the animation in the animation editor:

This is it ingame:

This is the code im using:

function Class.BeginDive(Character, State)
	local Root = Character:WaitForChild("HumanoidRootPart") assert(Root, "Expected HumanoidRootPart in character.")
	local Humanoid = Character:WaitForChild("Humanoid") assert(Humanoid, "Expected Humanoid in character.")
	local Animator = Humanoid:WaitForChild("Animator") or Instance.new("Animator")
	Animator.Parent = Humanoid
	
	local DiveStart: AnimationTrack = Animator:LoadAnimation(Animations.DiveStart)
	DiveStart:Play(0, 1, 1)
	
	DiveStart:GetMarkerReachedSignal("StartDive"):Connect(function()
		print("reached end")
		DiveStart:AdjustSpeed(0)
	end)
	
	local DiveCFrame = Root.CFrame
	Character:PivotTo(DiveCFrame)
end

Any help appreciated

Turns out it was an issue with me changing the pivot of the character, oh well.

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