How to make a part grow from one face instead of both faceses?

what im trying to do is make a beam that grows from one end, but its so hard to figure out how

heres what im trying to do


as seen in the video, instead of it growing from both sides, i want it to grow from one side
can some one give me a solution?

local TweenService = game:GetService("TweenService")
local part = script.Parent

local function blast(part)
	local beam = part:FindFirstChild("Beam")
	if not beam then
		warn("Beam not found in part.")
		return
	end

	local sizedata = 100
	local originalSize = beam.Size
	local newSize = originalSize + Vector3.FromAxis(Enum.Axis.Z) * sizedata
	local frontOffset = part.CFrame.LookVector * (originalSize.Z / 2)
	beam.CFrame = part.CFrame + frontOffset
	beam.CFrame = part.CFrame + part.CFrame.LookVector * (originalSize.Z / 2)
	local sizeTweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local sizeTween = TweenService:Create(beam, sizeTweenInfo, {Size = newSize})
	sizeTween:Play()
	sizeTween.Completed:Wait()
end

blast(part)

you will need to move it by half the amount you want to resize it by
like if you will increase its z axis size by 150 then you will need to move it to the z axis 150/2 or 75
example

local TweenService = game:GetService("TweenService")

local part = script.Parent


local extendZAxisBy = 50

local sizeTween = TweenService:Create(part,
	TweenInfo.new(8),
	{Size = part.Size + Vector3.new(0,0,extendZAxisBy)}
)

local PositionTween = TweenService:Create(part,
	TweenInfo.new(8),
	{Position = part.Position + Vector3.new(0,0,extendZAxisBy/2)} -- divided by 2 because origin point is at the middle of the cube
)

sizeTween:Play()
PositionTween:Play()

3 Likes

is there a way to make it into cframe? beause the beam is attached to a moving part?

2 Likes

Nvm i fixed it, DUDE YOUR A LIFE SAVIOUR!!!

1 Like

dude also one more question, how do i move a model?

1 Like

you can move a model with the :PivotTo(c :Frame) method

model:PivotTo(CFrame.new())
1 Like

Dude your a life savior thanks so muchhhhhh

2 Likes

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