Character sizing problem:

I am making a roleplay game. You can choose to be a kid.


When I chose kid, it was all going fine;
I had my avatar size smaller…
But when I published the game for testing, you could see other peoples avatars as, if they chose kid, legs in floor, normal avatar size.

It only effects your avatar. Is there any known way to fix this. Please edit the script to my needs in replies. Thanks :sweat_smile:

Below is a snippet of the script:

Frame:WaitForChild("Kid").MouseButton1Click:Connect(function()
	TeamEvent:FireServer("Kid")
	Close()
	wait(5)
	player.Character.Humanoid.HeadScale.Value = 0.5

	player.Character.Humanoid.BodyDepthScale.Value = 0.5

	player.Character.Humanoid.BodyWidthScale.Value = 0.5

	player.Character.Humanoid.BodyHeightScale.Value = 0.5
end)

Frame:WaitForChild("Adult").MouseButton1Click:Connect(function()
	TeamEvent:FireServer("Adult")
	Close()
	wait(5)
	player.Character.Humanoid.HeadScale.Value = 1

	player.Character.Humanoid.BodyDepthScale.Value = 1

	player.Character.Humanoid.BodyWidthScale.Value = 1

	player.Character.Humanoid.BodyHeightScale.Value = 1
end)

Frame:WaitForChild("Parent").MouseButton1Click:Connect(function()
	TeamEvent:FireServer("Parent")
	Close()
	wait(5)
	player.Character.Humanoid.HeadScale.Value = 1

	player.Character.Humanoid.BodyDepthScale.Value = 1

	player.Character.Humanoid.BodyWidthScale.Value = 1

	player.Character.Humanoid.BodyHeightScale.Value = 1
end)

Don’t worry! Player is defined lol.
So, recap; you see yourself as small but other players see you normal size but legs in floor as if CanCollide was off.
Thanks once again!

This issue occurs because you are running the script on the client. This makes it to where only you can see the changes in your avatar’s size, while everyone else sees the changes in your avatar’s position. Here’s a quick explanation:

The position of the character is replicated from client to server. HOWEVER, the size of a character is not. This means that as you scale down the size of the character on the client, the HumanoidRootPart, gets closer to the ground because the legs are shorter. In the images below, the green dot represents the center of the HumanoidRootPart.

Client: smaller character = shorter legs → feet need to touch the ground = root part moved down to about 4 studs

Server: client says character’s root part is 4 studs above the ground = root part on server is 4 studs above the ground = all other clients see normal character with root part approximately 4 studs above the ground

This issue can be remedied by changing your system to do this:

  • Detect click on client Kid/Adult/Parent Gui.
  • Send a signal to the server (via a RemoteEvent) to scale the character down.
  • Server scales the character down (using the code you already have, just executed on the server).

For more info on Roblox’s client-server system, I’d recommend checking out these articles on the DevHub.

1 Like

Hey there! I am not much of a scripter and I don’t know how I would do this. The script is a localscript, but it would need to be, wouldn’t it?

I also need it to be in the local script following what is in there before that. Isn’t there an easy way to make it change for all?

1 Like