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

How to make an object move 1 stud 50 times?

Asked by 7 years ago

for i = v do
game.Workspace.Part.CFrame = CFrame.new(1,0,0) end How do I make it so it moves (1,0,0) every time rather then goes there for 50 times.

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

It does. It just does so instantaneously. Add a wait() to the for loop.

Edit: Just noticed the actual issue (I blame lack of multiline code block :P)

game.Workspace.Part.CFrame = game.Workspace.Part.CFrame * CFrame.new(0, 0, -1)

For local space translation, or

game.Workspace.Part.CFrame = game.Workspace.Part.CFrame + Vector3.new(0, 0, -1)

For world space translation.

0
But the thing is my script gives it a location right? Or does it not? And where does it go. ZackVIII 10 — 7y
0
I did not read correctly. Oops. I will amend it. In future, put it in a multiline code block SwardGames 325 — 7y
Ad

Answer this question