how come these 2 that moves un-anchored parts going horizontal but not vertical?
--Horizontally
while wait() do script.Parent.Velocity = script.Parent.CFrame.LookVector * 3 end
--Vertically
while wait() do script.Parent.Velocity = script.Parent.CFrame.UpVector * 3 end
when the first loop begins running, it will run forever and the second loop won't continue, you can merge them together:
--Horizontally & Vertically while task.wait() do -- use task.wait it's faster script.Parent.Velocity = script.Parent.CFrame.LookVector * 3 + script.Parent.CFrame.UpVector * 3 end
Okay, then you can create a new thread, this will run independently from the rest of the script, you can do that using task.spawn
:
task.spawn(function() while task.wait() do script.Parent.Velocity = script.Parent.CFrame.LookVector * 3 end end) while task.wait() do script.Parent.Velocity = script.Parent.CFrame.UpVector * 3 end