The Cars won't go straight

I’m making a game called Hunting(Story)
I’m finished with the cars and lobby but the cars are…uh…out of the map
robloxapp-20200710-1356167.wmv (2.3 MB)

Here’s the script:

local car = script.Parent

while true do
	wait(8)
	for i = 1,100 do
		car:TranslateBy(Vector3.new(0,0,-1))
		wait()
	end
	for i = 1,100 do
		car:TranslateBy(Vector3.new(0,0,1))
		wait()
	end
end

It’s in the both cars, one script to the other car and another script to the other car
Please help

You are moving it on the wrong axis. Try using Vector3.new(0,1,0) or Vector3.new(1,0,0). One of them should work.

On the other hand, TweenService is a much, much better solution for what you are trying to achieve. Here is an article on it in case you don’t know what it is: https://developer.roblox.com/en-us/api-reference/class/TweenService

Here is a very straightfoward tutorial by @colbert2677 on how to tween models: Introduction to Tweening Models

1 Like

Ok sir i will try that btw thanks for your reply

1 Like