Help, I have this script that moves a car when it is anchored. It only moves once. How do I make it that it moves forever?
--something not to worry about
while true do
script.Parent.Parent:MoveTo(Vector3.new(1,0,0))
wait(0.1)
end
Help, I have this script that moves a car when it is anchored. It only moves once. How do I make it that it moves forever?
--something not to worry about
while true do
script.Parent.Parent:MoveTo(Vector3.new(1,0,0))
wait(0.1)
end
You can do Vector3 + Vector3 like this:
while true do
script.Parent.Parent:MoveTo(script.Parent.Parent.PrimaryPart.CFrame.p + Vector3.new(1,0,0))
wait(0.1)
end
add a "while loop" it will make it go on forever
How?
I'm pretty sure there is already one?
I'm pretty sure there is already one?
lemme check something
Wait, it only goes to a specific location. How do I make it move on one axis?
This shouldn't be a answer, it should be a question but you can do Vector3.new(1, newValue, 1) for example
I did that and it's still moving at that exact spot :(
The issue is that in the while loop, you are always moving the car to the exact spot. To make it move one direction, you should change the x, y, or z axis, depending on what direction. Please accept my answer if it helps out!
But how?
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Ugh, I give up. I'll just use unanchored cars. Sure they like to crash a lot. but it's the only option I can do