Skinned mesh rigs do not trigger ViewportFrame re-renders when animated

If an animation is played on a skinned character model while the model is parented to a ViewportFrame (wrapped in a WorldModel of course), the ViewportFrame will not re-render each frame as it should. As such, the animation won’t appear to be playing.

This can be reproduced by placing any skinned mesh rig into a ViewportFrame and playing an animation on that rig. Here is a video demonstration:

Attached is a simple repro file with side-by-side rigid and skinned rigs inside ViewportFrames to show the difference (same place as seen in the video).

ViewportFrameSkinnedMeshRenderBug.rbxl (64.0 KB)

(Yes, the rig is parented to a WorldModel and the WorldModel is parented to the ViewportFrame)

15 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

Please note that filling a bug report does not guarantee that it will be fixed once triaged.

5 Likes

Sorry for the delayed response. The issue is being looked at.

As a workaround, adding a Humanoid to the Rig, and using that to play animations should fix it:
image

2 Likes

This is also an Issue with Bones where they do not update ViewportFrames at all, even with a Humanoid within the model

We just ran into exactly the same issue. The problem is that since skinned mesh animations don’t change CFrames of any parts the viewport frame just doesn’t update. Our workaround is to just add a dummy transparent part that moves under ViewportFrame.WorldModel.

Here’s some example code:

local RunService = game:FindService("RunService")

-- move a dummy part slightly each frame to force viewport frame to update
-- this is required if the viewport frame contains skinned meshes which animate without CFrame changes
local ViewportFrameAnimator = {}
ViewportFrameAnimator.__index = ViewportFrameAnimator

function ViewportFrameAnimator.new(worldModel: WorldModel)
	local self = setmetatable({}, ViewportFrameAnimator)

	local dummyPart = Instance.new("Part", worldModel)
	dummyPart.Transparency = 1
	local offset = Vector3.new(0.0001, 0, 0)

	self.renderSteppedConnection = RunService.RenderStepped:Connect(function()
		dummyPart.CFrame += offset
	end)

	return self
end

function ViewportFrameAnimator:destroy()
	self.renderSteppedConnection:Disconnect()
end

return ViewportFrameAnimator

And to use:

ViewportFrameAnimator.new(worldModel)

Also remember to call destroy when the ViewportFrame is destroyed. It’s not a very elegant solution so will be good to have it fixed officially.

2 Likes

This issue is still being looked into by the engineers. When there is more info i will pass it along

4 Likes

In the recent release notes, there was mention of a fix for skinned mesh animations in viewport frame instances. Was that meant to fix this? If so, it doesn’t appear to have actually fixed it - my game is still experiencing this issue.

1 Like

This issue should now be resolved! If this issue is still occurring, please create a new topic for us to look into.

4 Likes

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