:ScaleTo() while moving is a problem

What do you want to achieve?
I am trying to achieve a system where a character can be scaled without being teleported back to the position where it was scaled.

What is the issue?
The issue is that everytime the one of the characters eat, they are scaled with :ScaleTo() but for some reason they get teleported back to where they were. I am assuming this has something to do with my local script that handles all the characters to move where the mouse is.

What solutions have you tried so far?
I’ve already tried a lot of things like using a loop to scale bit by bit thinking it would be better than changing size instantly or setting the HumanoidRootPart’s AssemblyLinearVelocity value and position value back to before the character was scaled.

I might just change the models to parts so i can scale it without having to use :ScaleTo()

Server Script that scales characters -

local rootPartVelocity = playerModel.HumanoidRootPart.AssemblyLinearVelocity
local rootPartPosition = playerModel.HumanoidRootPart.Position
				
playerModel.ScaleTo(playerModel, (playerValues.Mass.Value / 100))

playerModel.HumanoidRootPart.Position = rootPartPosition
playerModel.HumanoidRootPart.AssemblyLinearVelocity = rootPartVelocity
playerModel.HumanoidRootPart.AssemblyAngularVelocity  = rootPartVelocity

And I use RenderStep to keep all the characters in the workspace moving towards where the mouse is.

The ScaleTo function updates the CFrames of the parts. Since the CFrames are being updated on the server, the client’s CFrames get overridden. Since the server has an outdated version of what is on the client, the parts get moved back to outdated CFrames.

You either need to use ScaleTo on the client or override the CFrame changes from the server on the client.

1 Like

I knew that the server is always behind, I never thought of that! Thank you, it worked. :smile:

1 Like

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