Why is my animation playing weird?

Basically, I want to make the attempt to have a character hold a rather large rock (Why? Don’t ask.) But, it seems to be giving bugs. It’ll only play once 1, and two the animation looks very… Off. There are a few other issues, but I can personally solve them myself.

--[[
-- \\ P-Prompt // --

local PU = script.Parent

local ROC = script.Parent.Parent

-- \\ Functions // --

PU.TriggerEnded:Connect(function(Player)
	local RF = game:GetService("ReplicatedFirst")

	local Rock = RF.Animations.PickUpRock
	local RockWalk = RF.Animations.WalkingRock

	local RockAnim = Player.Character.Humanoid.Animator:LoadAnimation(Rock)
	local WalkingAnim = Player.Character.Humanoid.Animator:LoadAnimation(RockWalk)
	print(Player)
	local Weld = Instance.new("Motor6D")
	Weld.Parent = Player.Character.HumanoidRootPart
	Weld.Part0 = Player.Character.HumanoidRootPart
	Weld.Part1 = ROC
	print("It works?")

	RockAnim:Play()
	
	WalkingAnim.Looped = true
	WalkingAnim:Play()
	print("Oomph!")

end)]]

-- \\ P-Prompt // --

local PU = script.Parent

local ROC = script.Parent.Parent

-- \\ Misc. Variables // --

local RockCarrying = false

-- \\ Functions // --

PU.TriggerEnded:Connect(function(Player)
	local RF = game:GetService("ReplicatedFirst")

	local Rock = RF.Animations.PickUpRock
	local RockWalk = RF.Animations.WockRock
	local RockIdle = RF.Animations.IdleRock

	local RockAnim = Player.Character.Humanoid.Animator:LoadAnimation(Rock)
	local RockIdleAnim = Player.Character.Humanoid.Animator:LoadAnimation(RockIdle)
	local RockWalkAnim = Player.Character.Humanoid.Animator:LoadAnimation(RockWalk)
	print(Player)
	print("It works?")

	RockAnim:Play()
	RockAnim.Stopped:wait()
	
	local Weld = Instance.new("Motor6D")
	Weld.Parent = Player.Character.HumanoidRootPart
	Weld.Part0 = Player.Character.HumanoidRootPart
	Weld.Part1 = ROC
	RockCarrying = true
	print("Oomph!")
	
	if RockCarrying == true then
		RockIdleAnim:Play()
	end
	
	
	Player.Character.Humanoid.Running:Connect(function(IsWalking)
			if IsWalking > 1 and RockCarrying == true then
				RockWalkAnim.Looped = true
				RockWalkAnim:Play()
			else
				RockWalkAnim:Stop()
		end
	end)

end)

That’s the general script, and I don’t have the anim currently, but when I can show it indiviviually I will.

Set the animation priority to Action, that usually solves these issues:

*YourAnimationHere*.Priority = Enum.AnimationPriority.Action

image
Just got the time to do this, and it doesn’t seem to work. I manually changed it to an Action priority.

So you manually changed the priority of the animation to Action, and the animation is still glitchy?

Yup. So, I’m now questioning if it’s related to the actual animation or something completely different.

Have you tried to set the rock to massless?

Yeah, it’s Massless, but cancollide is false. Anchored is also false.

Have you tried to use a different object instead of the rock, then we will know if it is the rock or your humanoid, or the script.

Well, it’s not the part. I changed it to be a simple part, and added the same script and the same issues occured.

Have you tried changing this to > 0

And shouldnt it be “speed” not “IsWalking”?

so it would look like that… …

Even changing this didn’t do much. So, I’m still pretty confused.

1 Like