Viewport Frame Not Playing Animation Fully

  1. What do you want to achieve? Keep it simple and clear!
    I have a Rig parented to a WorldModel parented to a ViewportFrame. I want to animate the Rig whenever a player hovers their mouse over it.

  2. What is the issue?
    The current code “technically” works but the animation is choppy.

  3. What solutions have you tried so far?
    I’ve tried everything from parenting the local script in various places and as well as changing the rig. I’ve looped the animation in the animation editor and adding AnimTrack.Looped = true still does not fix this issue.


local VPCam = Instance.new("Camera")
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://15502526400"
local ProductFrame = script.Parent
local VPFrame = script.Parent:WaitForChild("ViewportFrame")
local Rig = VPFrame:WaitForChild("WorldModel"):WaitForChild("Rig")
VPFrame.CurrentCamera = VPCam
VPCam.CFrame = CFrame.new(Rig.HumanoidRootPart.Position + Rig.HumanoidRootPart.CFrame.LookVector * 5, Rig.HumanoidRootPart.Position)
local Humanoid = Rig:WaitForChild("Humanoid")
local AnimTrack = Humanoid:LoadAnimation(Animation)

ProductFrame.MouseEnter:Connect(function()
	AnimTrack:Play()
end)
ProductFrame.MouseLeave:Connect(function()
	AnimTrack:Stop()
end)

Video Proof:

I don’t know much about viewport but have you tried changing the animation priority?

Yea I have that on the highest Animation Priority aka Action4 and the issue still occurs.

I have something very interesting going on and I’m wondering how I can combat this issue.

Looks like when I start moving and hovering my mouse over it, it will play the full animation. Here’s some video proof and some new code. I would like to know how to keep the animation playing even if the mouse is not moving, but still within the frame?

ProductFrame.MouseEnter:Connect(function()
	AnimTrack:Play()
	AnimTrack:AdjustSpeed(1)
end)
ProductFrame.MouseLeave:Connect(function()
	AnimTrack:AdjustSpeed(0)
	AnimTrack.TimePosition = 0
end)

I’m having the same issue. The animation only updates when there’s a mouse input

Have you managed to find a fix for this that you can share? I imagine you could animate the character outside of the viewport and then copy the part CFrames but I kind of want to avoid that for simplicity

Edit: Found a bug report here ViewportFrame in CanvasGroup with animated joints doesn't re-render