How do I set the size of the player's parts before they join the game?

Hello. I am new to developing in Roblox as well as to the forum, so if this comes off as poorly researched or hard to read, I apologize.

  1. What do I want to achieve?
    I want to create an NPC that can replicate the player’s movement. The NPC would have to precisely replicate these movements, so to do this I record the player’s parts’ CFrames every frame, and then replay them but with the NPC’s parts. The NPC would have a different avatar to the player, which is what makes the task challenging.

  2. What is the issue?
    In order to achieve this, the size of the NPC’s parts have to be the same as the players. The main issue is that since there are so many different avatars, it is hard to standardize the sizes without breaking some players’ avatars. I do not want to change the player’s avatar in any major way (I am fine with removing certain UGC items if necessary, but I don’t want to mess up their avatar by removing their hair, for example). I also do not want to set the NPC’s part sizes to the player’s, as that can allow parts of my game to be spoofed.

  3. What solutions have you tried so far?
    I have tried using avatar settings, however I don’t think it is able to precisely change the sizes of each part. I tried to set the player’s part sizes when they join the game with a script, however this seems to break parts of their character (welds and animations, from what I have seen).

In Summary: Is there some easy way to set the player’s proportions without completely breaking their character?

4 Likes

Theres a property the models have called “Scale”

Basically scales the whole model together

(idk if this helps)

1 Like

This would help, however I think that players have different sizes per part. Also, if I set the size of each part individually, I think the animations/welds might break.

Another thing I have to consider is that players might have different types of parts? I am not sure how much of an impact this would have, but I hope there could be a way to set a default torso/arm

bump as I seem to not be getting much of a response

I don’t entirely understand your needs, but I’m assuming you just want to scale the model of the player. (Correct me if I’m wrong then we can work something out from there)
This post might be what you’re looking for:

Characters usually have standard sizes (if it’s R6) so you can just use an R6 model for the NPC.

I’m pretty sure there’s also an API that allows you to have a character copy another avatars properties 1:1 if that’s what you’re looking for.

2 Likes

Thanks for the response.

My question centers around how to make the player exactly the same size as the NPC. I would just scale the whole player to the size of the NPC, but the avatars of players are vastly different, and they might have, say, a different ratio of torso to arm for example. I want to know if there is a way to force players to have certain proportions without breaking their animations, welds or textures.

If I understand corrently, you want to know how to get the character’s individual limb size. I think you can get it somewhat like this:

print(game.Players.LocalPlayer.Character:FindFirstChild("LeftUpperLeg").Size)

This code prints the size of a LeftUpperLeg (of an R15 avatar). To set the size of a part to the character’s LeftUpperLeg size on the server side, you need a RemoteEvent, a script and a LocalScript.

This would be in a LocalScript:

local val = game.Players.LocalPlayer.Character:FindFirstChild("LeftUpperLeg").Size
game.Workspace.SetSize:FireServer(val)

This would be in a ServerScript:

script.Parent.OnServerEvent:Connect(function(plr, val)
	workspace.SizePart.Size = val
end)

And this would be the result:

1 Like

Have you tried the ApplyDescription method? I believe it changes the avatars limb sizes as well.

This post might help you as well

1 Like

From what I understand he has tried this method and manually made the changes to each limb, but this breaks the character welds.

ApplyDescription looks promising! I have also forced avatars into R6, which simplifies things a lot. I will get back to you when I try it.

1 Like

You can just clone the character (after disabling Archivable property) and have it as NPC

1 Like

I have been busy with other things, and as such I haven’t had time to check the Roblox Devforum in a bit, so I apologize for the late reply.

After forcing the player to R6, and then using avatar settings to set the main parts of the player (arms, legs) to the ones of the NPC, my system worked! I was stuck on this for months, and I am really grateful for all the help.

1 Like

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