How to set Destination to FollowerEntity?

I try to implement an ECS solution with A* PathFinding Project, but I cannot make it work…

A have a GameObject on a Sub-Scene with: Character Controller, AIDestinationSetter and FollowerEntity. The entity is well baked by sub-scene and instantiated by script on my project when needed.

But on the Entities Hierarchy I do not find any IComponentData or on any child.
How can I setup the destination or access to the Entity data from my generated entity ?!

I’m not a pro in ECS but I checked on FollwerEntity script and see no Baker/Authoring script ?!

Any tips, examples or direct help is welcome ! :slight_smile:

The default FollowerEntity does not have an authoring component, so I don’t think it will work in a subscene. If you put it in your base scene the Entity should be generated and connected to the gameobject. You should be able to then write ECS Systems to interact with it’s components.

If your looking to do completely ECS with your FollowerEntity in a subscene then you will need an authoring component like this one I made. Working with it is a bit different because it doesn’t have all the helper functions that the FollowerEntity script provides, but most should be fairly easy to figure out what component you need to access to achieve the same result.

Okay I think I understand it better.
I found this thread from you (Current state and plans for ECS integration? - #41 by Curtis) and I was trying to implement it :slight_smile:

Just I not understand

For this to work you have to add [ChunkSerializable] to the ManagedState class or the authoring Baker isn’t able to add it.

Ya that was the only change I had to make to Astar package code. You can find the script by searching in Packages
image

then just add it above the class

1 Like