Moving vehicles with PathfindingService

In my game, I have tiny vehicles that drive on roads. I am using the PathfindingService in order to move them around to their destination. Currently, I just have these vehicles as Humanoids. This is causing an issue when it comes to lag and the vehicles begin to glitch out or get stuck. I’m looking for an efficient way to move them instead of using Humanoids.

I was thinking about using CFrame, however, I need to have the vehicles be able to drop down if needed. My other idea was using BodyMovers.

Would one of these ideas work better than the other? Anyone have any other ideas?

Thank you!

2 Likes

You could always use a BodyPosition considering PathfindingService gives you points to move to. Would be fairly easy to port over to.

4 Likes

I started using BodyPositions but I kept having problems with rotating the vehicle. I switched over to using CFrame and got it working to a point. Sometimes the vehicles decide to drive off the road or fly into the air. I think I can get it working though.

Are the vehicles anchored? If you are moving them by setting the CFrame then it should still work when they are anchored, and be alot less buggy.

Yes they are anchored now. It seems to be helping with performance a lot.

So are the vehicles performing regularly now?