After replacing AI in game with FollowerEntity from Unity’s NavmeshAgent, everything has been working flawlessly. The only problem now is my playmode tests would fail if used run all, instead of running each one individually and the exception is world.DefaultGameObjectInjectionWorld is null.
If I create a new world, it becomes
InvalidOperationException: This system handle belongs to a different world.
Unity.Entities.WorldUnmanagedImpl.ResolveSystemStateChecked (Unity.Entities.SystemHandle id) (at ./Library/PackageCache/com.unity.entities/Unity.Entities/WorldUnmanaged.cs:718)
Unity.Entities.WorldUnmanaged.ResolveSystemStateRef (Unity.Entities.SystemHandle id) (at ./Library/PackageCache/com.unity.entities/Unity.Entities/WorldUnmanaged.cs:1132)
Pathfinding.ECS.EntityAccess`1[T].Update (Unity.Entities.EntityManager entityManager) (at ./Packages/com.arongranberg.astar/Core/ECS/EntityAccess.cs:154)
Pathfinding.FollowerEntity.Start () (at ./Packages/com.arongranberg.astar/Core/AI/FollowerEntity.cs:397)
I believe this is something to do with the fact that my playmode test changes scene, and something maybe is not reset properly with ECS. Any advice or solutions?