Im trying to make a tower defense game in which some cubes come from the black gate and go to the white gate, I set up a tween script to follow nodes which are the green orbs. heres my script:
local TweenService = game:GetService("TweenService")
local Parent = script.Parent
local count = 1
local TweenTable = {}
print("Wating!")
local Parts = game.Workspace:GetChildren()
for _,v in pairs(Parts) do
print("checked:"..v.Name)
if v.Name == "Node"..count then
count = count + 1
print(v.Name)
local tweenInfo = TweenInfo.new(10)
local goal = {}
goal.Position = Vector3.new(v.Position.x, v.Position.y, v.Position.z)
local tween = TweenService:Create(Parent, tweenInfo, goal)
print("playing Tween!")
tween:play()
end
end
Heres my Screen shot of where the objects show up link

2 comments
can you be more specific from what you mean by your script breaks?
Look at the link and it doesn't go to the point, and it just stops short and is broken