[ UN SOLVED ] Viewport Frame not copying player character

You can write your topic however you want, but you need to answer these questions:

  1. I want to make a loading animation with a “white shadow” of the player who joined walking in loop.

  2. The issue is the player’s character is not copying into the ViewportFrame so i cannot play the animation and apply the “white shadow”

  3. I have tried to make waits ( to let the time to the character to load ), add prints ( which does not print if they are after the parenting time ).

Here’s the code I have done:

local Players = game:GetService("Players")
local player = Players.LocalPlayer

local viewportFrame = script.Parent.ViewportFrame

local function capturePlayerCharacter()
	print("Capturing player character for:", player.Name)

	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:WaitForChild("Humanoid")

	humanoid.Died:Wait()

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

	characterClone.Parent = viewportFrame
	local camera = Instance.new("Camera")
	camera.Parent = viewportFrame

	camera.CFrame = CFrame.new(characterClone.Head.Position + Vector3.new(7, 1.5, 0), characterClone.Head.Position)

	print("Player character captured for:", player.Name)
end

capturePlayerCharacter()

Could you help me to fix/find the problem.

There is actually no answers. So i found how to proceed with a imported script and i will close this subject

There is a property Archivable that, when disabled, prevents you from cloning the instance. Player characters by default have Archivable false, but you can temporarily set it to true to get a clone.

local character = player.Character or player.CharacterAdded:Wait()

character.Archivable = true
local characterClone = character:Clone()
character.Archivable = false

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