Inventory system Character loading bug

Hello, i wanted to do inventory system with player’s character in it.
Inventory

But the problem is when i take player’s character and he is moving the resoult wil be this:
Inventory v2

i can’t copy player’s character so i had to clone every part/acessory. I tried stoping all animations in already cloned one but i didn’t work. (I can’t stop real players animations because it will ruin the game)

here is script i’m using:

local function UpdateCharacterFrame()
	local Character = game.Workspace[Player.Name]
	
	if Character then
		local NewModel = Instance.new("Model")
		NewModel.Name = "Character"
		
		if CharacterFrame.CharacterVPF:FindFirstChild("Character") then
			CharacterFrame.CharacterVPF["Character"]:Destroy()
		end
		
		local Camera = Instance.new("Camera")
		CharacterFrame.CharacterVPF.CurrentCamera = Camera
		Camera.FieldOfView = 50
		Camera.Parent = NewModel
		Camera.CFrame = CFrame.new(0, 2, 9) * CFrame.Angles(math.rad(-10), 0, 0)
		
		for i, v in pairs(Character:GetChildren()) do
			if not v:IsA("BodyColors") then
				local NewPart = v:Clone()
				NewPart.Parent = NewModel
			end
		end
		
		NewModel:PivotTo(CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(180), 0))
		CharacterFrame.CharacterVPF.CurrentCamera.CameraType = Enum.CameraType.Scriptable
		
		NewModel.Parent = CharacterFrame.CharacterVPF
	end
end

if anyone have any idea what can i do to make it so this animation won’t play, pls help me
(I can’t also make template character because some players have diffrent character types like block, R6 or R15)

Simple solution, have a default r6 model, then use humanoid descriptions in order to add the player’s stuff.

1 Like

can i play animations in that model if i will do it like this? i may want to add standing animation to this model

Yes. You can play any R6 animations on any R6 Rig. ALSO, you are able to copy the player’s character if you set Archivable to false. Example:

Character.Archivable = false
local ClonedCharacter = Character:Clone()

But you should load the character’s appearance onto a blank rig. The player’s character holds scripts and such. Cloning these scripts can lead to problems.

2 Likes

i can just delete these scripts
i didn’t know i can copy character like that

also, how will this rig react with avatar like this?
image
i can only copy properites, shirts or pants and i wanted it to be blocky (and hats)

yeah you can. Humanoid descriptions are what I used for the models in my game. And yes you will be able to play animations as it’s just a normal rig model through the animator objet inside the character model’s humanoid. This will work with different bodytypes, arms(like robot arms), etc.

I decided i will change starter character to custom one so i can use template model to load how player look, thx for help tho

Ig I will mark this as solved because idk how to close this lol

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