Hello,
I’m just starting to use A* in a simulator I’m creating for my college project.
I’ve added a button to reset the scene in Unity on click. I’ve tried 2 different ways of scene reset also.
public void ResetScene()
{
//SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
Scene scene = SceneManager.GetActiveScene();
SceneManager.LoadScene(scene.name);
print("Scene Restarted");
Time.timeScale = 1f;
}
Unfortunately on button click, while the scene does appear to reload, I get errors only relating to “Assets/AstarPathfindingProject/”.
Some of the errors in the console are:
Not allowed to access vertices on mesh ‘SM_Prop_Couch_05’ (isReadable is false; Read/Write must be enabled in import settings)
UnityEngine.Mesh:get_vertices ()
Not allowed to access triangles/indices on mesh ‘SM_Prop_Couch_05’ (isReadable is false; Read/Write must be enabled in import settings)
UnityEngine.Mesh:get_triangles ()
Not allowed to access triangles/indices on mesh ‘SM_Buildings_WallDoorDouble_5x3_01P’ (isReadable is false; Read/Write must be enabled in import settings)
UnityEngine.Mesh:get_triangles ()
Nothing else reports an error. I don’t understand why changing a setting in imports will resolve this issue when resetting the scene. This error does not show on first load. Only if I click my reset scene button.
Is there someway to gracefully reload a scene that has A* in it please?
Thanks for your time!