I need to catch the event when the player model has been completely rendered on the client side. I thought that the CharacterAppearanceLoaded is what I need. However, this doesn’t seem to be the case. I tried to check by printing some output inside the said event and I noticed that it prints way earlier before the character model has been rendered on the client-side. I checked the player model on the Explorer side and it seems the model parts are there. They are not just visible immediately. Here’s a video of what I am describing for reference:
If you check the console, both Client - Character Appearance Loaded and Server - Character Appearance Loaded were printed way before the player model was rendered. I’m just moving the player model the moment it’s added and I’m not doing anything else with the said model. The code I use to print the log is this:
self.PlayerRef.CharacterAppearanceLoaded:Connect(function()
print("Client - Character Appearance Loaded")
-- initialization code here
end)
I wrote the same code for server and client side module scripts.
So I would like to ask if my understanding of CharacterAppearanceLoaded is incorrect. Also, I would like to ask for a suggestion on how can I detect when the player model is completely loaded. Thank you very much.
As per the documentation that event/signal fires whenever all of a character’s ‘appearance’ instances have been inserted into that character’s model. Rendering is handled by the engine and a ‘Rendered’ event has yet to be added.
You may be able to use the ‘ContentProvider’ service.
local Game = game
local Players = Game:GetService("Players")
local ContentProvider = Game:GetService("ContentProvider")
local function OnPlayerAdded(Player)
local function OnCharacterAdded(Character)
if not Player:HasAppearanceLoaded() then Player.CharacterAppearanceLoaded:Wait() end
ContentProvider:PreloadAsync({Character})
print("Character's appearance has rendered.")
end
Player.CharacterAdded:Connect(OnCharacterAdded)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
Thank you for your response. I thought when they described the process of inserting instances into the character’s model, that included the rendering of the instances as well. Thank you for clarifying.
As for your suggested code, I tried that but unfortunately, the ContentProvider:PreloadAsync call still completes before the character is completely rendered
That’s unfortunate, PreloadAsync's task must be considered complete once the requested assets have loaded internally and not once they have rendered to the client. At the very least it should provide a better approximation to that of CharacterAppearanceLoaded.