David
David

Reputation: 4508

2d pathfinding in unity tower defense

I'm trying to make 2d tower defense game. For now I know there is way to place waypoints along the route, and order units to go via waypoints. But this way I don't like because of 2 problems. First the route is made of straight lines, second all units go via 1 line. I mean even if background picture shoes thick road which can handle several units marching side by side "waypoints" approach dos not allow me to do that. Any suggestions ?

Upvotes: 0

Views: 840

Answers (1)

Bilal Itani
Bilal Itani

Reputation: 180

Well if the issue with using way points and single lines is just that everyone is in the same line, you can design an algorithm for each group of creeps that makes them walk in a certain formation along a line toward a waypoint.

Alternatively, you could use a NavMesh, but that isn't necessarily required, and could get performance intensive with lots and lots of agents depending on your game; especially if you're planning on using mobile platforms.

Upvotes: 1

Related Questions