I’m trying to make a Character Viewport that’s still separate from the Player’s Character (kind of like a “mind of it’s own”).
The hats are possessed… not really. The hats are just following the REAL player while still in the Viewport and not properly attaching to the Viewport Character, instead attaching to the Workspace Character.
I’ve tried to reset the CFrame to see if it- didn’t work.
I then tried to delay the script so that it had time to registe- didn’t work.
Okay, so maybe I should try to manua- no.
This is what I’ve got so far, minus some extra code that’s not related to the issue.
local VP = script.Parent:WaitForChild("ViewportFrame")
local WM = VP:WaitForChild("WorldModel")
local VPChar = WM:WaitForChild("ViewportCharacter")
local Char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
while task.wait(0) do
for i,v in VPChar:GetChildren() do
if v:IsA("Accoutrement") then
if not table.find(Char:GetChildren(),v.Name) then
v:Destroy()
end
end
end
for i,v in Char:GetChildren() do
if v:IsA("Accoutrement") then
if not table.find(VPChar:GetChildren(),v.Name) then
local hat = v:Clone()
hat.Parent = VPChar
end
end
end
end
I’m still relatively new to coding and UI, and this probably isn’t the best- in fact probably the worst way to go about something like this, but I hope it’ll improve over time.
That caused the player to lose all their accessories, and because of the order it was in the Viewport Character didn’t have find any children of VPChar.
Maybe I got the problem, it seems like it’s still welded to the Player, so if the weld is child of the accessory it should keep all the info, you should either destroy the weld and make a new one with the correct info or directly change the parts welded
Happy you fixed the problem, sorry for the dumb take I said before, I had my brain turned off, and maybe you could also try with humanoid descriptions obviously
Update: I’m still suffering.
I tried a different way to go about updating the ViewportCharacter because it wasn’t working and I found another weird issue…
As soon as the CharacterAdded event fires the entire script just stops.
Please put your code in ``` so we can browse it easily, it seems like what you did is a bit counterproductive, it is a bit messy, try:
game:GetService(“Players”).PlayerAdded:Connect(function(player)
local VPChar = --what you wrote
print(VPChar)
local character = player.Character or player.CharacterAdded:Wait()
--etc.
outfit = Hum:GetAppliedDescription()
VPChar:WaitForChild(“Humanoid”):ApplyDescription(outfit)
end)
This script isn’t working, the Viewport/HumanoidDescription does not update to any changes on the current Character model so I’m going to try a different method.
Alright, so I’m beginning to believe there is nothing I can really do about the situation of the Viewmodel Character not updating to changes on the original Character…
I’m gonna paste the script here if anyone can somehow miraculously find the answer to the problem though.
local RepS = game:GetService("ReplicatedStorage")
local Player = game:GetService("Players").LocalPlayer
local thespot = Player.PlayerGui:WaitForChild("PlayerDisplay"):WaitForChild("Frame"):WaitForChild("ViewportFrame"):WaitForChild("WorldModel")
local VPChar = RepS:WaitForChild("ViewportCharacter"):Clone()
VPChar.Parent = thespot
local Character = Player.Character or Player.CharacterAdded:Wait()
local Hum = Character:WaitForChild("Humanoid")
local VPHum = VPChar:WaitForChild("Humanoid")
while task.wait() do
local Desc = Hum:GetAppliedDescription()
VPHum:ApplyDescription(Desc,Enum.AssetTypeVerification.ClientOnly)
end
I’m trying to make a UI for customizing your avatar, and I wanted to have a display that shows your character on the menu while you customize (I wanted UI to cover full screen but if I can’t get this to work I might have to resort to making panels and leaving the middle clear).
also the UI is supposed to be way bigger but I just shrank it while I developed the actual script.
At this point I’m just gonna have to delay on this feature, because nothing really worked. Thanks for all your help though! I’ll take a closer look next time and see that I get this done properly.
Why not just make the camera follow the character and move the character to the position instead of holding it in the center? Also ApplyDescription would only work if you modified the HumanoidDescriptions themselves versus changing it by parenting a new hat, etc…