Moving models along a path without :Moveto

I am making a tower defense game, and I opted to use animation controllers rather than humanoids for the enemies because I’ve heard humanoids are laggy.
An issue I ran into is making the models move along the set path at a variable speed that’s subject to change at any time. I tried making waypoints using parts, and then tweening each models cframe from part1 to part2 (2-3,3-4, etc), with the tween time being based on the distance between each part and the models current speed, but it didn’t look very good, and I’m not confident in it’s scalability. Is there a better way I could do this?

Using BodyVelocity is a great option. Set the Velocity property to a vector towards the next waypoint with magnitude 16.

You may need to add a vertical component to correct the height of the character occasionally if the legs don’t collide with the ground.

Here is a graph of what the Humanoid’s starting velocity is. The colors indicate which frame the sample was taken from, the first or second. You can see that by the second frame, the character should be up to the maximum velocity.

I’m working on a custom controller and pathfinder, and may end up supporting no-humanoid agents. You can follow the progress or submit a feature request here: Polaris-Nav

2 Likes

Sorry, I forgot the upload the graph I mentioned. You should be able to see it above now.