How can I scale or size a part on a global axis, instead of local, via script

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to grow or scale a part in a certain direction, no matter rotation.

  2. What is the issue? Include screenshots / videos if possible!
    I cannot find a way to scale a parts position on a global axis, instead of local, inside of a script.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    All solutions I’ve found relate to CFrames which don’t affect size.

3 Likes

You could probably achieve this affect using a server script, and the resize function for BaseParts.

3 Likes

The resize function works! However, I would then need to figure out how to translate a vector3 to a normal id. Unless there’s another way I can get the normal as a normal id.

local normalDir = (part:GetPivot().Position - part.Position).unit
script.Parent:Resize(normalDir,1)

It only looks like there’s a way to translate a normal id into a vector3, not the other way around. Though I might be wrong.

local size = obj.CFrame:VectorToWorldSpace(obj.Size)
size = Vector3.new(math.abs(size.Z), math.abs(size.Y), math.abs(size.X))
size = obj.CFrame:VectorToObjectSpace(size)
size = Vector3.new(math.abs(size.X), math.abs(size.Y), math.abs(size.Z))
objClone.Size = size

I figured it out a bit ago, but am answering this for other people struggling. The important parts are the 1st, 3rd, and 5th lines.

1 Like

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