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

Smooth moving bricks?

Asked by 9 years ago

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

Log in to vote
1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

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
0
what does "script.Parent.CFrame.p" mean? Position? or somthing? Or is that the Player. jerek123 0 — 9y
0
script.Parent.CFrame.p is getting the position of script.Parent based on script.Parent's CFrame. It's like script.Parent.Position.. Goulstem 8144 — 9y
0
Sorry Goul, your script is doing the same. its teleporting to it not moving jerek123 0 — 9y
0
Oh sorry! I didn't put a wait.. here you go(: Goulstem 8144 — 9y
0
Thank you! :) jerek123 0 — 9y
Ad
Log in to vote
0
Answered by
Uroxus 350 Moderation Voter
9 years ago

This may help you...

Answer this question