Joints reset when character changes appearance

I made a script that changes the appearance of an NPC using Humanoid:ApplyDescription(). When the game is run, the NPC changes from its original pose to the default pose. How can I prevent the joints from resetting when the NPC changes its appearance?

1 Like

Dunno if there is an easier way, though try…

Registering the joint values (e.g. joint.C0) to a table then change the joint values after the humanoid description is applied to the registered joint values.

1 Like

Im confused, could you provide an example?

@CreepingGamingTV says this:

local Weld
local Table = {}
Table["C0"] = Weld.C0
Table["C1"] = Weld.C1

And to load:

local NewWeld
NewWeld.C0 = Table["C0"]
NewWeld.C1 = Table["C1"]
2 Likes

When applying a description it more or less just removes your character and loads another in its place, however when saving or loading the bodyparts are still in default positions.

You shouod be able to move and offset joints from the motor6 present im the character to get the same position. You dont want to alter the attachments or welds themselves as they are rigid.

2 Likes

How would I reference the joints in the table? i.e how would I reference the right shoulder joint?

You can do it like this:

local Motor6D
local Table = {}
Table[Motor6D.Name]["C0"] = Motor6D.C0
Table[Motor6D.Name]["C1"] = Motor6D.C1

And to load:

local NewMotor6D
NewMotor6D.C0 = Table[Motor6D.Name]["C0"]
NewMotor6D.C1 = Table[Motor6D.Name]["C1"]
1 Like

Im still confused on how to fill in the table. What do the variables with no value mean (Motor6D and NewMotor6D)? Im new to scripting so I don’t know some of these concepts.

Motor6D is what you want to save.
NewMotor6D is the same engine, but after what you want to do.

local Table = {}
local Motor = Character.Head.Neck
Table["C0"] = Motor.C0
Table["C1"] = Motor.C1
-- What you want to do --
Motor.C0 = Table["C0"]
Motor.C1 = Table["C1"]

This snippet should be applied with every Motor6D you change.

1 Like