Introducing an Engine-Level Model Scale API [Beta]

I agree - in my case it caused game breaking errors/bugs by suddenly not working. Not ideal when I spent 70k of Robux on ads for the day

1 Like

@PineCrumb @plaincamron666

There was a bad, tricky to understand regression on iOS which caused Roblox to revert all flags up to a few weeks back for some iOS users in order to help diagnose the issue, and unfortunately ScaleTo was caught up in that window.

The flags should be back to normal sometime today, Iā€™ll keep you updated.

Perils of using recently enabled features :upside_down_face:. Usually you would be completely safe more than a week after a feature being enabled, this is an exceptionally unusual case, I canā€™t think of any other time a feature has come out of beta and been reverted more than a day later.

3 Likes

@PineCrumb @plaincamron666

Things should be fully back to normal now, sorry for the disruption.

1 Like

Hello! Iā€™m current having this weird scaling issue, Iā€™m not sure whether itā€™s to do with :ScaleTo, but basically:

When editing:

When running:

It appears that, when using :ScaleTo or using the built-in scale tool to size up the default R15 blocky avatar, the edit mode view does not represent the in-game view. Updating any of the Scale NumberValues under the Humanoid will result in the rig snapping to a thinner version with a smaller head.

This was pretty confusing for me as the animations I had made just seconds earlier resulting in their models clipping through walls, even though I made sure that they werenā€™t in the Animation Editor.

In my opinion, their proportions shouldnā€™t be changing like this. When I scale up a model, I expect to scale uniformly, not for certain parts to end up smaller or larger than they should be.

Iā€™m not sure whether a place file would help here, because it changes when running you likely will see it in edit mode as I see it in Run Mode because the scaling will be re-applied then and there, but here it is anyway:

broken-humanoid-editmode-scaling.rbxl (75.4 KB)

In this case, I manually ā€œfixedā€ the one on the right by scaling it down, but that still results in the wrong proportions.

2 Likes

Iā€™m having an issue with this feature trying to scale a character whilst it is moving. If a player is walking while ScaleTo() is called on their character, the character is killed and ā€œflungā€ far away.

To reproduce this issue, paste the following in the server console and start walking:

task.wait(5) workspace.[PLAYER NAME]:ScaleTo(4)

This doesnā€™t seem to produce the issue 100% of the time, but seems to occur fairly reliably for me on a completely blank baseplate. When my character is not moving, the scaling works just fine.

3 Likes

This is one of the best changes Iā€™ve seen so far, I randomly saw it when resizing something in my lobby, audibly gasped at the Scale property and came here to see its 10x better than what I thought. Thank you Roblox.

I created a test project based on the Racing template project, it seems that the ScaleTo() function has a problem with character collisions
robloxapp-20230623-1442085.wmv (1.1 MB)
TestScaleTo.rbxl (596.5 KB)

1 Like

I just ran into a bug with ScaleTo that made me go nuts because I couldnā€™t figure out for a while what was causing it. Thereā€™s some really odd interactions with physics when using ScaleTo.

I was trying to use the API to scale playersā€™ tools based on the size of their character because they can be resized in my game (I scale characters by changing their HumanoidDescription). So whenever a tool was equipped, Iā€™d make sure the scale of the tool was the correct size by calling ScaleTo. However, I noticed a wacky behavior when I would equip a new tool midair. I also noticed that equipping a tool on a swing would increase the velocity of it exponentially.

It turned out that even though the scale I was setting to the tool hadnā€™t changed, it was affecting the toolā€™s physics interactions. I think this issue is potentially related to previously mentioned issues on this thread from this past week.

Hereā€™s a quick reproduction that I made for a swing seat:

while true do
	local currentOccupant = script.Parent.Occupant
	if currentOccupant then
		local occupantCharacter = currentOccupant.Parent
		if occupantCharacter then
			occupantCharacter:ScaleTo(occupantCharacter:GetScale())
		end
	end
	task.wait()
end

Hereā€™s the place file for this reproduction as well:
ScaleToBugReproduction.rbxl (53.8 KB)

3 Likes

This feature appears to be a little buggy with animation scaling incorrectly. I had to rely on the animation resizer to get it right. Only in studio though, works fine in live game.

1 Like

Hi
I want to scale a character at runtime. ScaleTo() works perfectly if the character is standing still. However there are very noticeable physics flings when scaling while the character is moving/rotating.

I found instantly setting the AssemblyLinearVelocity and AssemblyAngularVelocity to what it was before the scale fixes this when called from the client.

However, I want the character scale to replicate to the server. Using the same ā€˜fixā€™ on the server isnā€™t as smooth, although it definitely helps.

Is there a way to dynamically scale a moving character that replicates to the server without physics flinging issues?

I additionally tried doing the scale on the client, and afterwards doing it server-sided but that doesnā€™t help either.

Attached is a studio file where the character scales every second. You can test the situations I described by enabling/disabling certain scripts.
scale_test.rbxl (46.2 KB)

Any help would be greatly appreciated.
Thanks

5 Likes

By the way, I see the bug reports here. Iā€™m going to do a pass on them soon, hold tight.

4 Likes

Came here to report client physics issues with ScaleTo method. Glad that Iā€™m not the only one experiencing those.

2 Likes

My solution to solve this is to handle Character:ScaleTo() on the client and just use remote events to tell each client to update. The only problem is you have to somehow handle the character on the server using a different way, as the scaling obviously doesnā€™t replicate to the server. Probably not much of an issue and I predict this issue will be solved within a week or so.

Regardless I think I might wait until this issue is fixed before releasing my game to avoid further issues.

1 Like

From my experience, setting scale on the client will also cause physics issues due to network ownership of the character. Even if you donā€™t tell the server nor other clients to replicate it.

Well Iā€™m changing it in a local script, and thereā€™s zero issues. Although, they might have changed itā€™s functionality in the past few days.

Probably a dumb question to ask but is there anything for changing a modelā€™s default scaling to 1 without having to ungroup/regroup a model? I have a bunch of models that arenā€™t scaled equal to 1 and I donā€™t want to have to ungroup & regroup each individual model just to reset their scale to 1 with the size theyā€™re currently at.
RobloxStudioBeta_chZPIvka9l

There isnā€™t a way right now but Iā€™m considering adding one. Iā€™m interested what the workflow reason where you want to do a mass reset is. Is it that you made a bunch of copies of props without paying attention to the scale and need a way to reset them all back?

You can automate it with a script if you need a solution at the moment. This could be run using the ā€œRun Scriptā€¦ā€ command in the Model tab:

for _, desc in workspace:GetDescendants() do
    if desc:IsA("Model") then
        local children = desc:GetChildren()
        for _, ch in children do ch.Parent = nil end
        desc:ScaleTo(1)
        for _, ch in children do ch.Parent = desc end
    end
end
game:GetService("ChangeHistoryService"):SetWaypoint("Reset Scale")
2 Likes

Actually, itā€™s probably better if I explain it with a video

  • If you take a model and manually scale it down, it also scales the modelā€™s Scale value to whatever you shrunk it to (to be expected)
  • ungrouping & regrouping the model would reset the scale back to 1 but at the size of what it was set to

The game Iā€™m using these models in has a ā€˜scaleā€™ tool that basically lets you scale up models to a value of choice, but the builder wasnā€™t aware of this new scale thing being added so itā€™d cause unexpected scaling issues like props being WAY too big because their scale was something tiny like 0.16 being bumped up to a size of 2.

Wait, so Iā€™m a bit unclear now. Is what youā€™re looking for a better way to do this programmatically at runtime in the building game, or at edit time in the Studio UI?

I also looked at support for this.

For me I wanted to use it for adjusting character scale. When a skinned mesh is imported from blender, sometimes the scale isnā€™t quite right. It has to be rescaled slightly to fit with the other models in game.

Ideally the rescaled character would then have a scale of ā€˜1ā€™ so we can more easily make it work with dynamic growth.

Definitely not a dealbreaker, but does make it so we have to keep track of what the original ā€˜max scaleā€™ was at. I.e. the scale the character grows towards.

An official method to set the scale would be handy.