How do I make an attachment always rotate toward the nearest waypoint? | Roblox Forum
Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

How do I make an attachment always rotate toward the nearest waypoint?

  • This website was created by Roblox members to replace the official forums because Roblox shut them down! Join our community if you like to talk about Roblox!
Not open for further replies.


Well-known Member
Jul 25, 2018
Hello, I am trying to make a vehicle AI for my personal chassis. I want to make this vehicle's attachments rotate toward the nearest waypoints. The attachments Y axis in the orientation make the wheels turn. The thing is, how do I script them to always be rotated to the nearest AI waypoint.
Example: I have 5 waypoints. They are called AIWaypoint(number), and they are in a model. I want the vehicle to rotate the FL and FR attachments to the nearest specific AI waypoint in that model, so it can follow paths and make turns. But I have no idea how to script this. I asked here to get help. Please no jokes.
The vehicle has a model named Chassis, and there is a part named Platform. There are attachments named AttachmentFL and AttachmentFR. If you rotate them both on the Y axis, they turn like a real car.
Here is the link to the model of the car, for further investigation:

Note: The car needs collision groups to work properly, they are set up like this:
Not open for further replies.
Help Users
    Thecoolguy16183 Thecoolguy16183: hey @Vipnoob07 i added you on roblox friend me its thecoolguy16183