I have a part that is constantly changing it's size by a script:

for i=0,0.005,0.00001 do
	s.Size = s.Size:Lerp(Vector3.new(100,100,100),i)
	s.CFrame = s.CFrame:Lerp(c.CFrame * CFrame.new(-90,0,0),i)
	wait()
end

(s = a part in the workspace)

Basically what i want to do now is add a small "Debris" to the part by calculating the size of the current part in the workspace and adding 10 studs on every axis.

I was thinking about coding it like this:

for i=0,0.005,0.0001 do
	d.Size = d.Size:Lerp(Vector3.new(s.Size*Vector3.new(10,10,10)),i)
end)

(d = Another part in the workspace representing the debris)

What i thought would happen is what i thought would happen with the same thing as i would use part.CFrame * CFrame.new(0,10,0) - Calculating the CFrame of the part and adding 10 studs above to it.

I found out that it doesn't work this way tho, and i can't figure out how to do it correcly. Every bit of help is appreciated. Thanks.

2 comments

0

Your variable names should be as straightforward as possible. The fact that you had to tell us what they are is concerning.

0

For me it isn't really a problem since i destroy them afterwards anyways. Plus the variables are only there for one function, so i can use them again in another one