Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Can We Tween The Size In A Certain Direction?

Asked by 3 years ago

You know how in Roblox studio edit mode you can scale part in certain direction for example when u pull on the green circle in pulls its size that way, yeah is it possible to do that in a tween and if so how?

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

local info = TweenInfo.new(
    3,         
    Enum.EasingStyle.Elastic,   
    Enum.EasingDirection.In,   
    0,                 
    false,              
    2                 
)

local Goals = {           
    Size = tweenPart.Size + Vector3.new(500,400,1000),



}

local PartTween = TweenService:Create(tweenPart, info, Goals)
PartTween:Play()

wait(5)

local info2 = TweenInfo.new(
    3,         
    Enum.EasingStyle.Elastic,   
    Enum.EasingDirection.In,   
    0,                  
    false,              
    2                    
)

local Goals2 = {         
    Size = tweenPart.Size + Vector3.new(-500,-400,-1000),
    Transparency = 1,


}
local PartTween2 = TweenService:Create(tweenPart, info2, Goals2) 
PartTween2:Play()

Here is my script if it helps in any way

0
This is easy, divide the size needed in the direction by 2 so that u have to travel the same amount in 1 direction then simultaneously change the position of the part, this will make sure it stays in the same place and changes size as well. greatneil80 2647 — 3y

2 answers

Log in to vote
0
Answered by
epoke466 100
3 years ago

I dont think that you can but, you can make another script that is disabled and have the script make the part move over a period of time:

while wait() do
part.CFrame = part.CFrame + CFrame.New(1, 0, 1, 0) --The added amount to the parts position.
end

something like that should work. Then you can enable the script and it will move the part. You would enable it when the tween starts to play and then disable it when it ends. The tween will make the part grow from both sides but while being moved so it appears to only be changing one side.

Ad
Log in to vote
0
Answered by 3 years ago

Just create two tweets and play them same time. One changes size, and the other changes to the position that's it thevp4ogonal position minus half the size, half the size being increased that is. This is because it increases the same amount in both directions so it must be cut in half so it moves that amount so it doesn't look bigger on that side

Hope this helps :3

Answer this question