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

Any way to change the way a part's size gets bigger?

Asked by 5 years ago

In a script I was tweening a cylinder part and saw how it increased in size from the center. It starts off as a flat circle, and then I want it to rise up to the cylinder shape, but when I do that, I noticed that it increases it's size from the center of the part, just as how CFrame and Positions are like that. Is there any way I can change the part from increasing in size by starting from the center, and instead have it go from being flat to rising up to being tall?

The script I tried:

local TS = game:GetService("TweenService")


game.ReplicatedStorage.ShadowMagic.ShadowR.OnServerEvent:Connect(function(plr)

    local Cylinder = bottom:Clone()
    Cylinder.Size = Vector3.new(0.5,20,20)
    Cylinder.Position = plr.Character.Torso.Position + Vector3.new(0,-2,0)
    Cylinder.Anchored = true
    Cylinder.CanCollide = false
    Cylinder.Transparency = 0.2
    Cylinder.Material = "SmoothPlastic"
    Cylinder.Parent = game.Workspace
    Cylinder.Name = "ShadCyl"

    local CylinderTI = TweenInfo.new(
        1.2,
        Enum.EasingStyle.Linear,
        Enum.EasingDirection.Out,
        0,
        false,
        0



    )   

    local CylinderProperties = {
        Size = Vector3.new(40,15,15),
        Transparency = 1
    }

    local CylinderTween = TS:Create(Cylinder,CylinderTI,CylinderProperties)
    CylinderTween:Play()
end)
0
You have to tween the position of it as well, to the position where you want it to be after the tween. The reason it's expanding from the center is because you're changing the size value, but not the position value, and the position describes the center of the part. jharnekus 3 — 5y
0
I did that, and it did nothing except tween the parts position from 0,0,0 to the character's torso. ScrubSadmir 200 — 5y

Answer this question