You can write your topic however you want, but you need to answer these questions:
-
I want to make a loading animation with a “white shadow” of the player who joined walking in loop.
-
The issue is the player’s character is not copying into the ViewportFrame so i cannot play the animation and apply the “white shadow”
-
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.