Viewport model not behaving as expected

I am trying to get my viewport frame to display the player’s avatar, however i am having issues with the model created by CreateHumanoidModelFromDescription.

When i load into the game to test if the player model displays, the accessories are bugged and seem to not be connected to the player model. Also it doesn’t move when i either change the primary part’s CFrame or when the :Move function is called on the model.


:Move being used


Moving primary part to origin


Moving player model to workspace


Putting player model back in viewport frame

Me deciding to use CreateHumanoidModelFromDescription was after i tried the following:

  • Using a blank rig which was preset to origin point and cloning accessories onto it (Shirt and pants would update but accessories were broken)
  • Cloning the player model from workspace and inserting it into the viewport frame (Model’s limbs were at an offset from the primary part)
local playerService = game:GetService('Players')
local viewportFrame = script.Parent.Parent
local camera = Instance.new('Camera')

camera.Parent = viewportFrame
viewportFrame.CurrentCamera = camera

local localplayer = playerService:CreateHumanoidModelFromDescription(playerService:GetHumanoidDescriptionFromUserId(playerService.LocalPlayer.UserId), Enum.HumanoidRigType.R6)
localplayer.PrimaryPart.CFrame = CFrame.new(0,0,0)
localplayer.Parent = viewportFrame
camera.CFrame = script.Parent.CameraCFrame.Value
Summary

Model is either not updating when inside viewport frame or i don’t know what I’m doing.

All animations that are played on the real character must also be played on the character in the viewport frame.

Try using :PivotTo() on the model instead of .Primary part.CFrame

This worked, but now I have the issue of the accessories not attaching until I put the model back into the workspace. Is there a way to fix this, or am I going to have to sloppily parent it to the workspace before putting it in the frame?

I just found a post that was made about this topic recently which solves the problem.

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