Anchor Point For Parts?

Hey there! I was wondering if there was a way that I can make the part scale only in the direction (kinda like anchor point for GUI’s) I’m telling it to scale, instead of both directions.

What I don’t want:

What I want:

Code:

local RS = game:GetService("ReplicatedStorage")
local Remotes = RS.Remotes
local resize = Remotes.Resize

local increment = 0.5/2
local oldSize = Vector3.new()
local oldCFrame = CFrame.new()

resize.OnClientEvent:Connect(function(target, set, face, distance)
	if set then
		oldSize = target.Size
		oldCFrame = target.CFrame
	else
		local Dist = math.round(distance/increment)*increment
		target.Size = oldSize+oldSize*Vector3.FromNormalId(face)*Dist
	end
end)

what you can do is when it scales you also position it by half of the scale amount or something similar as I have never tried such thing.

local RS = game:GetService("ReplicatedStorage")
local Remotes = RS.Remotes
local resize = Remotes.Resize

local increment = 0.5/2
local oldSize = Vector3.new()
local oldCFrame = CFrame.new()

resize.OnClientEvent:Connect(function(target, set, face, distance)
	if set then
		oldSize = target.Size
		oldCFrame = target.CFrame
	else
		local Dist = math.round(distance/increment)*increment
		target.Size = oldSize+oldSize*Vector3.FromNormalId(face)*Dist
		-- target.Position += target.Size/2 -- ???
	end
end)

I though so, unfortunately it seems I can’t get adjusting the position right and the script you provided makes the part just go ridiculously far.

can you show me the video with my script?

Here you go:

What you can do is: Have a origin position aka before scaling the part then have a offset aka the size kinda stuff than add the offset in the origin and set it to the target position.

I’ll try that when I can. I’ll get back to you on that soon.

You can use the Resize function for BaseParts

Yes, I tried it using the resize but then I’d have to change the way I scale it. Maybe you know how I could use :Resize() in my case?

@kalabgs

Bumping cause I still need help.