R15 Character Scaling

Is this also what’s causing hats to be disconnected from characters when any scale is changed? Any timeline on a fix?

It’d be great if we could get 1.2 for height when we increase the limit from 1.05. Here is a comparison between 1.0 and 1.2:

The height difference is only 0.8 – such a small difference would pose little issue while empowering users with significant customization options. I would love to have a character with height 1.2x.

6 Likes

A fix for this will be released on Thursday. The issue is that Accessory welds are in the Handle of the Accessory and they are being broken when the character is re-scaled (I only tested with Hats :frowning:). The fix will make it so any welds with the character are not broken when the character is scaled.

If you want to use scaling now I’ve got a fix for this in the test place here:

The fix is in ServerScriptService. It re-welds the accessories to the character, this won’t be necessary after Thursday.

5 Likes

T H I C C

1 Like

It looks like there’s also another issue with joint duplication. R15 characters spawn with duplicate joints (not attachments), and whenever you copy and paste the characters, the joints are duplicated again. I suspect this is because whatever is responsible for managing joints on scale creates new ones whenever a character is created. Not sure if this will be fixed with the update on Thursday.

Also, perspective:

8 Likes

I will look into the duplicate joints issue, thanks for the report.

4 Likes

Probably the same issue, but just in case it’s not, whenever the character spawns the Humanoid HipHeight is reset to what the character scaler things it should be.

A separate issue is that HipHeight is calculated incorrectly on spawn. When I set my height to 120% in realtime, my HipHeight is set to 1.62 – this is the correct value. When I spawn in, my HipHeight is set to 1.92 for some reason, and if keep copying+pasting the character HipHeight keeps increasing – after duplicating the character a couple times I got HipHeight up to 11.

2 Likes

To save others some time, if you try changing what a body part is attached to and your character flies off into oblivion, check for this:

One RightShoulder is attaching the limb to UpperTorso, and the other RightShoulder is attaching the limb to a different part. The limb can’t be in both places so the joints fight over where it should be and hence you go flying away.

2 Likes

Alright. Who broke character scaling. This is a key mechanic in this game and it was working fine before… Heads and hats won’t scale now.

4 Likes

Going to need more information here, scaling is working fine in my testing place.

2 Likes

Sorry for not previously providing more details, thought it was site-wide.

Looks like it effects characters differently. I’m not sure why. I went to visit my game and found other players who had found all badges, which lets you shrink on command. My head never got scaled. The person to my right got everything scaled but their hats, and the person on the left got everything scaled but lost his hats.

The code is rather dead simple.

event.OnServerEvent:connect(function(player)
game.Workspace:findFirstChild(player.Name).Humanoid:findFirstChild(‘BodyDepthScale’).Value = 0.23
game.Workspace:findFirstChild(player.Name).Humanoid:findFirstChild(‘BodyWidthScale’).Value = 0.23
game.Workspace:findFirstChild(player.Name).Humanoid:findFirstChild(‘BodyHeightScale’).Value = 0.23
game.Workspace:findFirstChild(player.Name).Humanoid:findFirstChild(‘HeadScale’).Value = 0.23
game.Workspace:findFirstChild(player.Name).Humanoid.HipHeight = 0.37
end)

2 Likes

The man and woman heads don’t scale with the head part

I don’t think hats scale with HeadScale (yet?)

2 Likes

The game didn’t have these issues last week at all. Every single player lost their hats and had their heads scaled, including my “Man” head. Previously the default specialmesh head would scale TOO tiny though.

Now regular heads are scaling fine, hats are sometimes not scaling, sometimes disappearing and some heads aren’t scaling at all.

1 Like

Accessories being dropped wasn’t intended. Currently character scaling doesn’t scale accessories any smaller (we may add this later). I would recommend scaling the accessories manually for now. I will add a code sample for how to do this to the wiki later.

There was a bug fix for the default head being scaled too small and this seems to have introduced another bug where the other heads are not being scaled at all, we will fix this.

2 Likes

I’ve been using character scaling almost like a mechanic, where you need to be small to get into secret/hidden places that a normal sized player can’t fit in. Sooo…

Should I delete all accessories when I scale my characters for now, so their hats don’t block them from going places? Or are all accessories can’t-collide?

Edit: I guess I’ll be deleting them anyway considering they don’t scale… I’d almost rather them just fall off like they did last week, because anybody using character scaling is going to be doing this too?

1 Like

Any word on this? Just spent some time debugging why my avatar was able to ragdoll in play solo but @Simbuilder’s avatar wasn’t, and it turned out the reason was he had a duplicate Root joint in his avatar and I didn’t. Tested on the same machine, same test file, by setting Player.CharacterAppearance.

1 Like

Will fix, we are in code freeze until the end of the year though so this bug fix will be in the first client release of 2017.

3 Likes

Alright, thanks for the status update!

For anyone that needs this fixed in their games, I’ve been using this to get around it (after I figure out what the problem is at least):

--CharacterAdded in server script:
local rigHeight = character:WaitForChild("Humanoid"):WaitForChild("BodyHeightScale")
wait(1)
rigHeight.Value = rigHeight.Value + 1
rigHeight.Value = rigHeight.Value - 1

Changing the rig height forces the joints to rebuild, removing the duplicate ones. Without the wait it doesn’t work. wait() without the 1 or spawn may work also, and doing it clientside may correct the issue as well. I haven’t put too much effort into a clean solution since I mostly just need it for testing purposes and not for a live game, so you may want to modify it to be more elegant for your purposes (and make sure to post back here with results!)

1 Like

Can you post code for scaling hats relative to head size on R15?
I tried doing it myself, but my values for everything that’s not a “Hat” are a little off. It’d help a lot with anyone scaling R15 between now and 2017.

1 Like

Sorry, I meant to post this code a few days ago.

function findFirstMatchingAttachment(model, name)
	for _, child in pairs(model:GetChildren()) do
		if child:IsA("Attachment") and child.Name == name then
			return child
		elseif not child:IsA("Accoutrement") and not child:IsA("Tool") then -- don't look in hats or tools in the character
			local foundAttachment = findFirstMatchingAttachment(child, name)
			if foundAttachment then
				return foundAttachment
			end
		end
	end
end

local function getOriginalScale(handle)
	local origScaleValue = handle:FindFirstChild("OriginalScale")
	if not origScaleValue then
		origScaleValue = Instance.new("Vector3Value")
		origScaleValue.Name = "OriginalScale"
		origScaleValue.Value = handle.Size
		origScaleValue.Parent = handle
	end
	return origScaleValue.Value
end

local function findHandleMesh(handle)
	for _, obj in pairs(handle:GetChildren()) do
		if obj:IsA("DataModelMesh") then
			return obj
		end
	end
end

local function getAccoutrementWeld(attachmentPart, handle)
	local accessoryWeld = handle:FindFirstChild("AccessoryWeld")
	if accessoryWeld then
		return accessoryWeld, accessoryWeld.Parent
	end
	
	-- Legacy case
	for _, obj in pairs(attachmentPart:GetChildren()) do
		if obj:IsA("Weld") then
			if obj.Part0 == handle or obj.Part1 == handle then
				return obj, obj.Parent
			end
		end
	end

	return nil
end

local function rescaleAccessories(character, bodyScaleVector, headScale)
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	for _, obj in pairs(character:GetChildren()) do
		if obj:IsA("Accoutrement") then
			local handle = obj:FindFirstChild("Handle")
			if handle then
				local originalSize = getOriginalScale(handle)
				local currentScaleVector = handle.Size/originalSize
				local desiredScaleVector = bodyScaleVector
				
				local accoutrementAttachment = handle:FindFirstChildOfClass("Attachment")
				local characterAttachment = accoutrementAttachment and findFirstMatchingAttachment(character, accoutrementAttachment.Name) or nil
				local attachmentPart = characterAttachment and characterAttachment.Parent or character:FindFirstChild("Head")
				
				if attachmentPart then
					if attachmentPart.Name == "Head" then
						desiredScaleVector = Vector3.new(headScale, headScale, headScale)
					end
					local modifyVector = desiredScaleVector/currentScaleVector

					local accoutrementWeld, oldParent = getAccoutrementWeld(attachmentPart, handle)					
					accoutrementWeld = accoutrementWeld and accoutrementWeld:Clone() or nil -- Weld will be broken when scaling, create a new one
					
					handle.Size = handle.Size * modifyVector
					local handleMesh = findHandleMesh(handle)
					if handleMesh then
						handleMesh.Scale = handleMesh.Scale * modifyVector
					end
					
					if accoutrementAttachment then
						-- Accessory case is easier
						accoutrementAttachment.Position = accoutrementAttachment.Position * modifyVector
					end
					-- Legacy hat logic case
					local x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = obj.AttachmentPoint:components()
					obj.AttachmentPoint = CFrame.new(x*modifyVector.x, y*modifyVector.y, z*modifyVector.z, R00, R01, R02, R10, R11, R12, R20, R21, R22)
	
					local attachmentCFrame = characterAttachment and characterAttachment.CFrame or CFrame.new(0, 0.5*headScale, 0)
					local hatCFrame = accoutrementAttachment and accoutrementAttachment.CFrame or obj.AttachmentPoint

					if accoutrementWeld then
						accoutrementWeld.Parent = oldParent
						if oldParent == handle then
							accoutrementWeld.C0 = hatCFrame
							accoutrementWeld.C1 = attachmentCFrame
						else
							accoutrementWeld.C0 = attachmentCFrame
							accoutrementWeld.C1 = hatCFrame
						end
					end
				end
			end
		end
	end
end

-- Used like this, call after re-scaling the character with the new scale values.
rescaleAccessories(game.Workspace.Player1, Vector3.new(0.75, 2, 1), 1)
8 Likes

Howdy Guys ; I am truly thankful , glad and honored to be Finally a member of this forum :smiley:

I only wanted to Inform my fellow developers here that I probably made the very First R15 Morphing system and the very First free ; really working and reliable ; constraints based R15 Ragdoll death system :smiley:

You guys can fell free to update and Improve my stuff ; Especially my Ragdoll death isn’t working with custom character scales and Packages ->So pls can someone update it ?

Also beware you might get a stroke from viewing my scripts , but I am just a unexperienced beginner ^^

8 Likes