Strange behavior with attachments while setting size

What I’d like to achieve is something like this https://gyazo.com/485c7a4268c2a8c883282761b4882eeb (The attachments sticking to the corners of the PrimaryPart)

The problem I am having is when I do

game.Workspace.Dummy.HumanoidRootPart.Size = Vector3.new(8,8,2)

The attachments do not move Positions seen in https://gyazo.com/48fe1c9d1200daaa930f32ecc512f324

I have done a brief search of the forums and have not seen anything to answer my question.

4 Likes

Still looking for help on this.

Perhaps when you set the size of the part, iterate over all attachments inside the part, and you get the ratio of the new size and the old size. You then multiply that by the current attachment position to scale the attachment to the ratio the part was scaled down. Then set the position to that.

So, something like this:

local part = script.Parent
local attachment = part.Attachment

local currentSize = part.Size
local newSize = Vector3.new(25, 17, 20)

local ratio = newSize / currentSize

part.Size = newSize
attachment.Position = attachment.Position * ratio

Here is a demo place you can check out: Attachment.rbxl (18.4 KB)

6 Likes

Thank you, this is exactly what I was looking for.

1 Like