Is there a way to make an automatically applying character script run faster (or set body scale defaults)?

I have a localscript that changes the size of the player as soon as they join (doesn't need to be replicated)
players = game:GetService("Players")
player = players.LocalPlayer

player.CharacterAdded:Connect(function()
	print("tests")
	local humanoid = player.Character:WaitForChild("Humanoid")
	print('tessts')
	print(humanoid.HeadScale.Value)
	humanoid.AutomaticScalingEnabled = false
	humanoid.HeadScale.Value = .1
	humanoid.BodyDepthScale.Value = .1
	humanoid.BodyWidthScale.Value = .1
	humanoid.BodyHeightScale.Value = .1
	humanoid.AutomaticScalingEnabled = true
	print(humanoid.HeadScale.Value)
end)

(For some reason I have to set automaticscaling to false and then set it to true again for the scale to apply)

However, due to having to wait for the character to load, there’s a noticeable delay after spawning before the size change happens. Is there a way I can somehow either get this script (and by extension the player character) to load faster, or, preferably, set the humanoid body scale defaults?

1 Like

Do player.CharacterAdded and wait for the humanoid.

1 Like

You can do this in two ways, probably more but these are the ones I can think of off the top of my head:
1st option: Game settings > Avatar > scroll down to Scale and adjust the settings there. The only thing with that, though, is that you’re constrained to proportions allowed on the Roblox avatar editor.

The second option is a more manual approach but if your main concern is that the character is going to be way too big for a brief moment, this will ensure that doesn’t happen.
1- Build an R15 rig using the rig builder
image
2- Manually adjust proportions inside the humanoid.
3- Rename the rig to “StarterCharacter”, parent it to StarterPlayer like so:
image
4- Write a script to get the humanoid description for whomever owns the character, parent this script to StarterCharacterScripts.

local players = game:GetService('Players')

local character = script.Parent

local player = players:GetPlayerFromCharacter(character)
local userId = player.UserId

local success, humanoidDescription = pcall(players.GetHumanoidDescriptionFromUserId, players, userId)
if not success then
	warn('Failed to get HumanoidDescription for', userId, 'because', humanoidDescription)
	return
end

-- now let's remove the scaling
humanoidDescription.HeadScale = 0.1
humanoidDescription.DepthScale = 0.1
humanoidDescription.WidthScale = 0.1
humanoidDescription.HeightScale = 0.1
humanoidDescription.BodyTypeScale = 0.1
humanoidDescription.ProportionScale = 0.1

character:WaitForChild('Humanoid'):ApplyDescriptionReset(humanoidDescription)

5- profit (observe that when I respawn my character isn’t giant for a brief moment, it’s always tiny)

Here’s a copy of the place in the aforementioned video:
tinyChar.rbxl (67.5 KB)

1 Like

Thanks, I can skip the last steps since it’s singleplayer and locked first person.

I wasn’t aware you could place models in the starterplayer like that.

1 Like

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