Hi Chris,
I am creating an ActionCharPathFind programmatically using the CreateNew function. I believe all the arguments are correct, but when the action list is executed I get the error:
"cannot pathfind without a Paths component"
This message is printed when ownPath, in Char.cs file, is null. The ownPath is checked on Awake function, and if it is found to be null, it is added. So technically it should not be possible that ownPath is null. But:
Checks I have done:
Any light as usual is very welcome.
Thanks in advance!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Is your CreateNew function passing a character in the scene, or the prefab?
If AC tries to manipulate the original prefab asset file it'd likely cause this issue. Though it should be possible to remedy this.
That is a good question!
I pass the one of the elements of the array returned by
KickStarter.settingsManager.GetAllPlayerPrefabs( )
Is that correct?
I have done a quick test. I went through all gameobjects of the scene and look for the ones that has a Player Component, and past that one instead. It works, but it is kind of expensive.
Could not the settingsManager track the spawned objects in the scene? something like: settingsManager.actorsInCurrentScene( ) / npcInCurrentScene( )
By the moment I will manage using the events to keep a cache of the players/npc. Brutal force
The previous brutal force solution works for all non-active characters. Right now, I am not able to find the default character gameObject. settingsManager.player has not the correct value.
This function returns all of the prefabs - not their respective scene instances. I can look into providing an alternative function that does this, but it is possible to get them by manually iterating through the players List:
This refers to the Player prefab when Player-switching is set to "Do Not Allow".
In either case, the active Player can be gotten with: