Accessing FollowerEntity properties

I have not been able to figure out how to access the public properties of the FollowerEntity component. My other scripts can’t even find the FollowerEntity component. I assume this is something to do with ECS.

Is there a relatively straightforward & efficient way to access the component and its properties?

Using GetComponent<FollowerEntity>().myProperty should work just fine.

Make sure you have using Pathfinding; at the top of the script.

I already had that (other than using GetComponentnParent instead of GetComponent), and it didn’t work, initially. Now it does.

Trying to figure out what had changed, I noticed that if the RichAI script is on the component and placed higher than the FollowerEntity script, it causes problems. This is with the RichAI script disabled. Not sure what’s going on with that, but I’ve tested it a dozen times each way now, and that’s the pattern.

Anyway, everything seems to be working now, so thank you.

1 Like