Is there a way to set anchor points on parts, like yk in ui where if u set an anchor point to the left and resize it it only resizes to right side. Thats what i want for a part except on y axis
How it is:
How i want:
Is there a way to set anchor points on parts, like yk in ui where if u set an anchor point to the left and resize it it only resizes to right side. Thats what i want for a part except on y axis
How it is:
Honestly, there’s a major annoyance with this. Since Pivot Point/ Pivot Offset doesn’t change when resizing a part, you’ll have to manually do translations, even for positioning.
local part = thePart
local pivot = part:GetPivot()
local offset = part.PivotOffset
local offset_count = offset.Position/part.Size
local increment = Vector3.new(5, 5, 5)
part.Size += increment
part.PivotOffset = offset + (offset_count * increment)
part:PivotTo(pivot)
Note:
If you’re multiplying by the increment, updating the pivot would be part.PivotOffset = offset + (offset_count * increment * part.Size)
.
I honestly have no other idea asides from this, if there is a better way. Although for models, pretty sure Model:ScaleTo()
does automatically recalculate the pivot offset (I don’t fully remember so you’d need to test that yourself if it pertains to you).
Also will add on, for the second mp4 you sent that’s less annoying and rather easy.
Just update the CFrame by half the incremented size value.
local part = thePart
local increment = Vector3.new(5, 5, 5)
-- // Depending on which face you want it to be resized from
local side = -Vector3.zAxis -- // This is from the back
part.Size += increment
part.CFrame *= CFrame.new(increment * side * .5)
-- // For multiplication it's
local part = thePart
local increment = Vector3.new(5, 5, 5)
local side = -Vector3.zAxis
local size = part.Size
part.Size *= increment
part.CFrame *= CFrame.new((part.Size - size) * side * .5)