So, I am planning to make a car that follows a certain path (around a race track) and that’s the only path. One attempt that I thought I could do was making a sort of thin invisible track which the car must follow, but wasn’t entirely sure what script I would use for that. I thought that the :MoveTo might come in use for making this, but also wasn’t entirely sure on how to use it.
If you could suggest something I could look into that might work that would be great, I’m not requesting any sort of code as I want to use this as a learning curve, thanks!
To add, I don’t need it to go different ways each time, I just want each car to follow an exact path on the racetrack which is the same every single time.
I created a car that essentially follows a part and finds the angle between the part and the car and drives towards it. Are you looking for something like this: AI CARS.rbxl (148.2 KB)
Note: This does not use the pathfinding service given by Roblox.
Sorry for bump, but having to print the target angle every time causes the game to lag extremely. I fixed the lag by removing the Print() function in your script.
You can use pathfinding to place some parts on the path which car will go. And then you should use tween service for smooth move.
Here is a example of tween:
local ts = game:GetService(“TweenService”)
local part = script.Parent
local info = TweenInfo.new(2)
local properties = {Position = —position of the part which generated in way—}
local tween = ts:Create(script.Parent,info,properties)