Introducing an Engine-Level Model Scale API [Beta]

Awesome! This is a huge feature that will make any kind of experience that deals with scaling models much easier, thanks for your diligent work on it!

1 Like

Any roadmap or estimate on when animations can be scaled with script live?

1 Like

When ScaleTo releases on production. Everything is in place for a full release when the next mobile force update happens, so not that far away.

4 Likes

just switched my games’ scaling to use the new scaleto, only to find out its not accessible yet :skull:

1 Like

Your question has already been replied to previously:

2 Likes

oh my bad, thank you very much!

1 Like

Currently, adding parts to a model that’s scaled down or up doesn’t scale the parts accordingly. Are there any plans to change that, or will it be up to the dev, whether they wish to do so, to scale down the part’s size manually before inserting it to the model?

1 Like

Short answer: Scaling is always going to be a one-shot action.

Long answer:

The Roblox engine fundamentally has a very direct “What you see is what you get” style. If you have an Instance, it isn’t going to move or change size, or otherwise change appearance unless you explicitly tell it to do so, which is always eventually done though changing its properties (though possibly through an intermediary API call like this one)

As such scaling currently (and likely always will) takes the form of a one-shot action which scales the subject Instances by modifying their properties, rather than being a continuously applied scale transform that applies to whatever happens to be under the scaled hierarchy.

3 Likes

So I know that we need to scale tools manually, but how do animations work in that case?

Say I have a tool that has some parts rigged with Motor6Ds, the character holding the tool has its scale set to 2, and the tool has not been scaled at all. What happens? Does the animation on the rigged tool parts also get scaled? Or do they remain the same?

The scale of the Model the Animator is rooted under is the scale that gets used for the animation being played on that Animator.

So if you had a separate animator under the tool then that would use the Tool’s scale factor, not the Character’s one.

1 Like

Is there any time frame on when this will be released in live experiences? Really excited to use it.

Speak of the devil!

The beta feature has just been rolled out to 100% of Studio users and I’ll be enabling the API on production this Wednesday the 7th if no unexpected crashes come up.

10 Likes

Model:ScaleTo and Model:GetScale are now live on production, enjoy!

The beta will remain active in Studio at 100% rollout for a while longer in case anyone runs into tooling issues and needs to opt out to work around them.

23 Likes

Will I run into performance issues with tweening ScaleTo? (Or if tweening isn’t possible, running it many times per second to give the effect of it tweening)

Yes and no, but mostly yes, you’ll see performance issues.

You can use it to tween scale of simple objects, and probably even get away with tweening scale of a Character in real-time if you do it on the client, but the API is designed for consistency / ease of use purposes, not for efficiency.

If you couldn’t scale something efficiently enough before with raw property sets ScaleTo will not be significantly more efficient than that was, because ScaleTo is still setting the same properties underneath, just avoiding some of the overhead that came from the Lua reflection.

What you definitely can’t do is tween scale of something significantly complex on the server because that will spam the network with way too many property replications causing network lag.

One day the API may be upgraded to do better network replication and efficiency wise but for now it still does the same property sets as anything else underneath.

5 Likes

Will we see a feature to remove certain instances or properties that are affected by :ScaleTo? It’s especially annoying that it changes the WalkSpeed and JumpPower of humanoids.

In my game, setting a character’s scale to anything other than 1 results in AssemblyLinearVelocity to not work as effectively as it should, however manually changing the size of the player without changing scale doesn’t do this at all.

The player characters in my game have everything set to massless except the HumanoidRootPart.

Thanks for the report. I’ll look into it, that isn’t something that I would expect to be an issue.

3 Likes

On desktop I’m able to use ScaleTo() just fine, however on mobile it errors in console with “ScaleTo is not enabled yet”

Am I missing something?

4 Likes

Came here to comment the same thing, was working fine yesterday on mobile but appears to be not working today. Was it temporarily disabled? I feel less confident using the feature for my live game if I can’t be certain it will always be enabled

3 Likes