Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can i make this part grow on the z axis only instead of both the z and x axis?

local part = script.Parent
local tweenservice = game:GetService("TweenService")
local goal = {}
goal.Size = Vector3.new(0, 0, 20)
 local info = TweenInfo.new(5)
local tween = tweenservice:Create(part, info, goal)
tween:Play()

1 answer

✓ Accepted answer

I think you meant that the it grows toward and backward at the same time.

You can move the part by size.Z/2 toward or backward, so this is the final result.

local part = script.Parent
local tweenservice = game:GetService("TweenService")
local goal = {}
goal.Size = Vector3.new(0, 0, 20)
goal.Position = part.Position + Vector3.new(0,0,part.Size.Z/2)--[[
^This is toward.
Otherwise if you want to move it backward then just do -part.Size.Z/2
--]]
 local info = TweenInfo.new(5)
local tween = tweenservice:Create(part, info, goal)
tween:Play()

This is not the final resolution to the question, I will adjust it if it doesn't match what you actually meant.

Details:Vector3.

This discussion is preserved as it was. New answers, comments, and votes are closed.