Position is global. It is a Vector3.
CoordinateFrame (position/rotation combined) is local. It is a CFrame.
The part's CFrame.lookVector is also a Vector3, one that points in the direction of the front of the object with length of 1 stud.
So you can do this:
local SPEED = 20
while wait() do
part.Position = part.Position + part.CFrame.lookVector*SPEED/30 --the /30 is because this runs per frame
end
, which directly changes the position (this means that your part will 'jump' on top of other objects it's going to intersect), or you can do this:
while wait() do
part.CFrame = part.CFrame * CFrame.new(0, 0, -1*SPEED/30)
end
, which affects the CFrame (this means the part will go straight through objects; it's the better option IMO). |