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

Simple script. How do I resize the parts?

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

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 

1 comment

0

If the CanCollide property is disabled, then he Part may change it's position automatically.

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