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

Smooth moving bricks?

So i've asked this question before but got the wrong answer. i want a brick to move smoothly to its distance not teleport to it.

for i = 1, 100, 0.1 do --100 is the limit, 1 is the place basic place, and 0.1 is what it counts by.
script.Parent.CFrame = workspace.Player1.Torso.CFrame * CFrame.new(5,i,0)
end

I have done this with size also and still ends up the same. i also conducted experiments using print and it all works fine except size and place.

2 answers

Well, why your script isn't working correctly for you is because you're multiplying the CFrame in a loop, it will multiply the CFrame EVERY iteration through the loop. Try Adding the CFrame from the Original CFrame, then it should work for you(:

local orig = script.Parent.CFrame.p

for i = 1, 100, 0.1 do
	script.Parent.CFrame = CFrame.new(orig + Vector3.new(5,i,0))
	wait(.1)
end

5 comments

0

what does "script.Parent.CFrame.p" mean? Position? or somthing? Or is that the Player.

0

script.Parent.CFrame.p is getting the position of script.Parent based on script.Parent's CFrame. It's like script.Parent.Position..

0

Sorry Goul, your script is doing the same. its teleporting to it not moving

0

Oh sorry! I didn't put a wait.. here you go(:

0

Thank you! :)

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