Character scale and hats, hair, etc. bad scaling

I have been playing around with character scaling and I have an issue where hats and hair and various other character attachments are not scaling properly. Whats interesting is that the player themselves never sees their own issues, but they do see other players scaling issues.

How to fix?

example:

1 Like

Can you describe the process you take to create the accessories and add them to characters? Most particularly who (client or server) is doing each part of the process. Accessories are very picky regarding replication. You should make sure you’re creating the accessory and adding it to characters all on the server.

Also make sure neither the accessory or the characters are anchored.
Additionally, scaling doesn’t work on accessories that consist of more than one part - but this shouldn’t be your issue.

These are the hats and so forth that players bring in on their avatars, I do not create them

It happens to their heir too

That’s interesting. Are you doing anything unconventional with characters? Spawning them yourself? Changing their parents?

not at all, just changing their BodyDepthScale, BodyHeightScale, BodyWidthScale, WalkSpeed and JumpPower

Where are you applying scaling? Server or client?

The script is a server script applied to player.Character.Humanoid

here is the script

local humanoid = player.Character.Humanoid    	
if humanoid then
		if humanoid:FindFirstChild("BodyHeightScale") then
			humanoid.BodyHeightScale.Value = potion.scale
		end
		
		if humanoid:FindFirstChild("BodyWidthScale") then
			humanoid.BodyWidthScale.Value = potion.scale
		end
		
		if humanoid:FindFirstChild("BodyDepthScale") then
			humanoid.BodyDepthScale.Value = potion.scale
		end
		
		if humanoid:FindFirstChild("HeadScale") then
			humanoid.HeadScale.Value = potion.scale
		end
		
		humanoid.WalkSpeed = defaultWalkSpeed * potion.walk
		humanoid.JumpPower = defaultJumpPower * potion.jump
end

I can’t seem to reproduce this. Can you make and share a simplified file that reproduces this issue?

I can start working on that, but first I want to check you understood my OP. the player themselves cannot see this issue, only other can. You will need multiple people to see it.

In other words, a player can only see the scaling issue on other players. To yourself, you avatar always looks fin.

I understand the issue. Your images are plenty sufficient to show the problem.

OK cool, will start working on it now, thanks

@qqtt991

testScale.rbxl (28.0 KB)

Heres an image, we just reproduced the issue just now. Here is how I looked to another player:

and here is how I look to myself:

Another image from a mobile device has my hair inside my back and glasses behind my head

This might be a replication bug with avatar scaling.
cc @CodeWriter

Looking into this file has lead me to a similar conclusion as @Maximum_ADHD.

This seems to be caused by changing the scaling values too quickly, one after each other. If you add wait(1) between each if block in characterScale.initializeScale() in the CharacterScale module, the issue no longer occurs.

Obviously this isn’t the optimal solution for a game.

OK so i need a 1 second wait between each of BodyDepthScale, BodyHeightScale, BodyWidthScale?

Thats a long wait between each one. Will try it now

You can get away with just wait(), but there is a noticeable delay unfortunately.

I frequently see issues with manipulating character scale values too quickly.
I’ll put together a thread for this since I can’t find one for this particular case.

So yeah, i added a delay of 1 and also .1 and in both cases I still got the problems

besides it is very bad looking to see all the scales change that way.

Strange. Resolves the issue for me.

The issue

Fixed

Code changes - note the wait()s

Actually, it looks like you’re doing this before the character has even fully spawned. You need to use CharacterAdded. This resolves the problem without any gross wait juggling.

I don’t think I’d call this a bug. It’s moreso undefined behavior.

In ServerHandler, make the following changes to the characterScale.initializeScale(player) line.

player.CharacterAdded:Connect(function(char)
	characterScale.initializeScale(player) -- this handles settign up the player for scaling events as well as setting initial scale
end)

My testing partner said he saw no glitches on my avatar, but I saw one on his. I did a second test just now and got this:

and this:

here is the code:

also I am in an actual live game, not in studio test modes. Would that matter?