Path Data in ECS?

  • A* version: [5.4.4]
  • Unity version: [6000.2.7f2]

Hello!

When using a fully ECS Follower Entity/Destination Setter, how would one get access to the path data? Also, another question, if I wanted to go about writing my own ECS movement script, how would you recommend I go about getting/calculating a path inside the ECS ecosystem?

Hi

You can use the FollowerEntityProxy struct to access FollowerEntity data using an easy to use api.

See FollowerEntityProxy - A* Pathfinding Project

If you need to access the data in jobs, check the implementation of FollowerEntityProxy for the properties you are interested in, which will reveal which components contain that data.

Calculating paths inside ECS is a bit tricky. You can check the SchedulePathSearchSystem and PollPendingPathsSystem for inspiration.

1 Like

Understood, thanks for the info, Aron!