Currently when my part tweens it scales in all directions, however, I just want it to scale on one axis.
How do I fix this?
My code:
Open = true
ClickDetector.MouseClick:Connect(function()
if Open == true then
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false, 0)
local part = script.Parent.Parent.Parent.Shutter
local goal = {Size = Vector3.new(12.872, 0.511, 0.05)} -- New size.
local tween = tweenService:Create(part, tweenInfo, goal)
Open = false
tween:Play()
elseif Open == false then
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false, 0)
local part = script.Parent.Parent.Parent.Shutter
local goal = {Size = Vector3.new(12.872, 0.511, 0.05)} -- New size.
local tween = tweenService:Create(part, tweenInfo, goal)
Open = true
tween:Play()
end
end)
Alright, I just made something that used similar scripting. Assuming that the current problem is that the part is scaling in both directions, you can include something like this,
Position = Vector3.new()
If you are scaling the part on the x axis for example, keep the y and z position the same, you can change the x axis so the part will move with the scale.
If this isn’t what you wanted, or you want me to explain it differently just let me know.