Resizing parts that use mechanical constraints freeze

If I try to resize a part that is connected via a mechanical constraint for example a spring the part freezes

here is a video of the problem

here is a project with the problem
ResizePhysics.rbxl (56.8 KB)

and here is the script within the project

local RunService = game:GetService("RunService")
local part = script.Parent

workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.CameraSubject = part

RunService.Heartbeat:Connect(function()
	part.Size = Vector3.one * math.random()
end)

if the spring is disabled then it will works fine

2 Likes

I just tested to see if editable meshes have this same problem and they donโ€™t

local AssetService = game:GetService("AssetService")
local RunService = game:GetService("RunService")

local options = {CollisionFidelity = Enum.CollisionFidelity.Hull, RenderFidelity = Enum.RenderFidelity.Precise, FluidFidelity = Enum.FluidFidelity.UseCollisionGeometry}

local mesh = AssetService:CreateEditableMesh()
local content = Content.fromObject(mesh)
local vertex1 = mesh:AddVertex(Vector3.new(0, 1, 0))
local vertex2 = mesh:AddVertex(Vector3.new(-2, -1, 0))
local vertex3 = mesh:AddVertex(Vector3.new(2, -1, 0))
local vertex4 = mesh:AddVertex(Vector3.new(0, -1, 2))
local face1 = mesh:AddTriangle(vertex1, vertex3, vertex2)
local face2 = mesh:AddTriangle(vertex1, vertex4, vertex3)
local face3 = mesh:AddTriangle(vertex1, vertex2, vertex4)
local face4 = mesh:AddTriangle(vertex2, vertex3, vertex4)
local normal1 = mesh:AddNormal()
local normal2 = mesh:AddNormal()
local normal3 = mesh:AddNormal()
local normal4 = mesh:AddNormal()
mesh:SetFaceNormals(face1, {normal1, normal1, normal1})
mesh:SetFaceNormals(face2, {normal2, normal2, normal2})
mesh:SetFaceNormals(face3, {normal3, normal3, normal3})
mesh:SetFaceNormals(face4, {normal4, normal4, normal4})

local part = AssetService:CreateMeshPartAsync(content, options)
part.Position = Vector3.new(0, 30, 0)
part.Parent = script.Parent

local attachment = Instance.new("Attachment")
attachment.Parent = part

local spring = Instance.new("SpringConstraint")
spring.Visible = true
spring.Attachment0 = attachment
spring.Attachment1 = workspace.Part2.Attachment
spring.Parent = part

workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.CameraSubject = part

RunService.Heartbeat:Connect(function()
	mesh:SetPosition(vertex2, Vector3.new(-2 + math.random() * 2, -1, 0))
	mesh:SetPosition(vertex3, Vector3.new(2 + math.random() * 2, -1, 0))
	mesh:SetPosition(vertex4, Vector3.new(0, -1, 2 + math.random() * 2))
	part:ApplyMesh(AssetService:CreateMeshPartAsync(content, options))
end)

Can you set the script context to โ€œserverโ€ and try it again? Thanks!

this is what happens if I make the server resize the part

but if I give the client network ownership and make the client resize the part then it works




but I also have another problem that Iโ€™m not sure if its 100% related to this problem


in this example the client has network ownership and if I resize the part it freezes the hole assembly
TestResize.rbxl (73.7 KB)
here is the project if you would like to test for yourself

one strange thing about this problem is if I rename the parts it fixes itself


after more testing just renaming Torso makes it work
I was not able to find any other word that broke it Torso is the only word iv found so far that breaks it and its case sensitive so torso works fine

Edit*
after more testing even renaming does not solve all problems for example instead of setting the size to 3 if you set the size to 1 it will freeze its very strange Iโ€™m not able to pinpoint the exact location that causes the problem

1 Like


In the video you shared, you were changing the context from server to client. Can you try with server context please? Thanks!

that is just to set the camera subject the script that is resizing has a context of server

I cannot repro the issue with the resizin script context set to the server. Can you share the updated placefile with me? Thanks!

Sure thing

ProblemA.rbxl (56.9 KB)

ProblemB.rbxl (73.5 KB)

and here are new videos of both problems


Problem A


Problem B

1 Like

Oh, Iโ€™m allowed to talk on the dev forum now- cool!

Anyway, Iโ€™ve experienced a similar issue with a previous version of one of my game concepts, where players would be given a tool midway through playing that attaches a rope to an unanchored object that already existed.
Itโ€™s hard to explain, but at random, one of the following would happen when the tool is equipped:

  • All players would see an accurate, (though laggy), view of the unanchored object being pulled by the rope behind whoever is holding it.
  • Only the player with the rope tool would get the previously described view, and from a server perspective the object would remain in place doing what it would normally do. When the tool is unequipped, the object will return to its true position for all viewpoints.

Iโ€™m trying to reiterate on this idea with more experience, and Iโ€™m planning to have the constraint attached to an object that follows the player rather than directly attaching it to the player, because it seems that the underlying issue is with a constraint being attached to a client sided object and a server sided object at the same time.