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

Why is this CFrame not working properly?

while wait() do
	for i = 1,10,1 do
		wait(.5)
		script.Parent.Size = Vector3.new(script.Parent.Size.X,i,script.Parent.Size.Z)
		script.Parent.CFrame = CFrame.new(Vector3.new(script.Parent.Position.X,script.Parent.Position.Y+.5,script.Parent.Position.Z))
	end
	for i = 10,1,-1 do
		wait(.5)
		script.Parent.Size = Vector3.new(script.Parent.Size.X,i,script.Parent.Size.Z)
		script.Parent.CFrame = CFrame.new(Vector3.new(script.Parent.Position.X,script.Parent.Position.Y-.5,script.Parent.Position.Z))

	end
end

Even though with CFrame, parts can go through parts, for some reason this isn't working properly.

4 comments

0

How exactly isn't it working?

0

You know how CFrame allows parts to go through each other? Well It's kinda working as if I just changed the Position. Like the parts won't collide with each other.

0

I'm not sure, since i don't use CFrame a lot, but i would recommend you to unanchor the parts first, and then when u end u can anchor them.

0

You don't need to anchor them.

1 answer

Here is how I generally use CFrame and it works for me every time:

script.Parent.CFrame = script.Parent.CFrame (+ or -) Vector3.new(x,y,z)

So I reccomend you try something like this:

for i = 10,1,-1 do
        wait(.5)
        script.Parent.Size = Vector3.new(script.Parent.Size.X,i,script.Parent.Size.Z)
        script.Parent.CFrame = script.Parent.CFrame-Vector3.new(0,0.5,0)
end

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