I'm trying to make part longer but when i make the Z on size to 2 it goes 0.5 longer on both direction
How do i make a part longer on 1 direction?
2 answers
All you have to do is position it in the direction you want it to be resized by half of that added size.
So basically if you want a part longer by 2 studs in 1 direction then just move it 1 stud in the same direction.
You have two options:
1. Use :Resize()
There is a method for BaseParts called Resize that resizes the part on a certain face. However, if the part comes into a collision, it will move upwards & mess up the position. Something like this:
script.Parent:Resize(Enum.NormalId.Front,0.5)
will make the part 0.5 studs bigger on the front face.
2. Move the part after changing the size
However, I recommend just moving the position after you change the size:
local function Resize(Amount)
local CF = script.Parent.CFrame
script.Parent.Size = script.Parent.Size + Vector3.new(0,0,Amount)
script.Parent.CFrame = CF + Vector3.new(0,0,-Amount/2)
end
Resize(script.Parent,0.5)
That just moves the part half the distance it's resized, keeping it in the right position.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
kk