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

I am trying to make an object that moves along a straight line but it won't budge. Any answers?

Asked by 5 years ago
Edited 5 years ago

I have an object that I want to move back and forth along a straight line. Here is the script:

local PrimaryPartCFrame = script.parent:GetPrimaryPartCFrame()


while wait() do
    for i = 0,-10,-.05 do
    script.Parent:TranslateBy(Vector3.new(0,0,i))
    wait()
    if PrimaryPartCFrame = 42.507, 10.469, -710.04 then
    script.Parent:TranslateBy(Vector3.new(0,0,-i))  
    wait()
    end
end 
end

It doesn't move. How do I fix this?

EDIT: I probably should have mentioned this is a model.

1
use tweenservice User#23365 30 — 5y

Answer this question