Getting character in ViewportFrame to be sized and position correctly

local camera ='Camera')

character.Archivable = true

local characterClone = character:Clone()
characterClone.Parent = playerIcon

for _, v in pairs(characterClone:GetChildren()) do
	if v:IsA('Script') then

characterClone:SetPrimaryPartCFrame(, 0, 0))

playerIcon.CurrentCamera = camera

I’ve tried messing with the CFrame of the primarypart which no number I put in moved the character closer to the camera

Hard to see, but the black square is the viewport, and the lil character in the frame is the model.

1 Like

Try moving the ViewportFrame’s camera around instead:

 -- ...
playerIcon.CurrentCamera = camera
camera.CFrame =,10,10),characterClone.PrimaryPart.Position)

This should do something, it might even fix your problem. I don’t know though, so play around with it.

1 Like

You clone the character, position their character to 0,0,0 and have them face the camera object. Then, distance the camera away from the player and face it towards their root or whatever you choose.

You can play with the player’s total height to generate the camera distance to keep it more align across different sizes, might prove to be a bit tedious though.

Seems to be working better. However, can you explain why half the assets aren’t showing up??

And now it does this

Some weird behavior, you could wait for the player’s appearance to be loaded. Or load their character + the appearance in, on their client instead of cloning the character.

I haven’t tried this, but you could look at the code. I am unaware of any new API or changes that just load the character and it’s appearance in. So hopefully this works.

1 Like