Animation is different in-game compared to animation editor

I don’t know if this is a script related or animation related bug.


I have set the animation to highest priority Action4, yet nothing.

3 Likes

Do you have any other animation’s that could be overriding that one? Like an idle animation for example.

Yes there is an idle animation and walking animation

First off. What is the animation priority?
Second, whats the PrimaryPart for the rig you are using?

Animation priority is set to Action4
PrimaryPart is Body
I will send you the whole model in a second and the script

local animationNum = 0
for i,v in RS.AnimationsList:GetChildren() do
local template = animationBar.Main.AnimTemplate:Clone()

template.Parent = animationBar.Main.Animations
template.Visible = true
template.Name = v.Name

local camera = Instance.new("Camera")
camera.Parent = workspace.Cameras
camera.CFrame = CFrame.new(10000 + animationNum + 7, 1000, 10000) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))
template.Button.Display.CurrentCamera = camera

local worldModel = Instance.new("WorldModel")
worldModel.Parent = template.Button.Display

local dummy = workspace.StarterCharacter:Clone()
dummy.Parent = worldModel
dummy:PivotTo(CFrame.new(10000 + animationNum, 1000, 10000) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)))

local animation = v:Clone()
animation.Parent = dummy 

local animation1 = v:Clone()
animation1.Parent = player.Character
local animTrack = player.Character.Humanoid.Animator:LoadAnimation(animation1)
animTrack.Looped = false
animTrack.Priority = Enum.AnimationPriority.Action4
animTrack:AdjustWeight(10)

loadedAnims[v.Name] = animTrack

local humanoid = dummy:FindFirstChildOfClass("Humanoid")
if humanoid then
	local animator = humanoid:FindFirstChildOfClass("Animator")
	if not animator then
		animator = Instance.new("Animator")
		animator.Parent = humanoid
	end
	local animationTrack = animator:LoadAnimation(animation)
	animationTrack.Looped = true
	animationTrack.Priority = Enum.AnimationPriority.Action4
	animationTrack:Play()
end

template.Button.MouseEnter:Connect(function()
	animationBar.Main.TextLabel.Text = v.Name
end)

template.Button.MouseLeave:Connect(function()
	animationBar.Main.TextLabel.Text = ""
end)

template.Button.MouseButton1Click:Connect(function()
	for i,v in player.Character.Humanoid.Animator:GetPlayingAnimationTracks() do
		v:Stop()
	end
	
	task.wait(1)
	
	loadedAnims[v.Name]:Play()
end)

animationNum += 10

end

image

Correction: primarypart is Body

Set the primary part probably to the RootPart.

I have no idea what fixed this but someone provided me with a place that this was working in. I guess solved? I’ll try to provide an explaination for future if anyone comes to this post looking for help

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