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

Simple script. How do I resize the parts?

Asked by 7 years ago
Edited 7 years ago

How do I resize an object correctly? The object doesn't go through other parts, instead it gets flung up.

c1 = script.Parent.Parent.c1
c2 = script.Parent.Parent.c2

function onClicked()
    for i = 1,30 do
        c1.Size = Vector3.new(c1.Size + Vector3.new(0, 0, 10.06))
        c2.Size = Vector3.new(c2.Size + Vector3.new(0, 0, 10.12))
    end
    wait(5)
    for i = 1,30 do
        c1.Size = Vector3.new(c1.Size + Vector3.new(0, 0, -10.04))
        c1.Size = Vector3.new(c1.Size + Vector3.new(0, 0, -10.10))
    end
end

script.Parent.ClickDetector.mouseClick:connect(onClicked)

1 answer

Log in to vote
0
Answered by
KenzaXI 166
7 years ago

First o all, make sure the Parts have the property: "CanCollide" enabled, and then just use the "Resize()" function.

For example:

c1:Resize(Enum.NormalId.Bottom,- 10.04) -- You Can change "Bottom" to whatever side you're changing 
0
If the CanCollide property is disabled, then he Part may change it's position automatically. KenzaXI 166 — 7y
Ad

Answer this question