So I am trying to make a script which gets a "node" or a green orb and goes to it. it gets them in order like this: node1, node2 etc. It then makes a tween to go to the position of the orb. But instead it doesn't do that or animate or anything, It just teleports off to the side of the track before My player can load. And if i add a wait(10) it doesn't work at all
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
