Forum rules - please read before posting.

NPCs not Pathfinding after adding Object

Hi, I am using AC 1.60.7 and Unity 2017.3. I set the Pathfinding update to 2 seconds in the Settings. I added an NPC using the Object Add feature (relative to nothing) to make the game scalable. Then I attempted to Walk to a Marker. However, the NPC does not move and I keep seeing "Cannot pathfind without a Paths component." 

The Paths component is actually on the NPC, which was created automatically using the NPC creation feature. I tried with other NPCs and get the same result. What should I do?

Comments

  • By the way, I'm using Unity Navigation for the Pathfinding method.
  • edited February 2018
    Welcome to the community, @zeebler.

    I shall attempt to recreate the issue, thanks for posting.  Are your other NPCs also added in using the Object: Add or remove Action, or is this Action affecting characters present in the scene file as well?
  • edited February 2018
    I have been attempting to use the Object Add action for all of the NPCs. I have the prefabs stored in my Resources folder. I failed to mention that I also added a Moveable component to the NPCs.
  • Characters register their own Paths component via their Awake function, and this ought to occur in the same frame that they are spawned in, before being told to move.

    As a test, try using the Engine: Wait Action to wait, say, 0.5s, once they've been spawned but before making them move.  Are they then able to move?

    If your NPCs are all spawned at runtime, then your Actions will have to refer to them by Constant ID number - which should auto-generate and be displayed in the Action.  Is this the case, and are you using scene-based ActionLists (e.g. Custsenes) or ActionList asset files?
  • edited February 2018
    Hi again... I have been using a scene-based ActionList... with GameObject parameters for the NPC and the marker.  The Constant IDs do not appear within the ActionList. I tried this one more time without an ActionList passing in parameters. When I did, not only did the Constant ID appear, but I saw there was a "Recalculate Pathfinding" option. 

    Then I realized that my dedicated ActionList had GameObject parameters for the NPC and the marker.  When I did that, there was no "Recalculate Pathfinding" option! I didn't realize that there was an option missing there. Is there a way to have the option available or do I just need to revamp my ActionList without parameters?
  • This option won't show unless a character is explicitly assigned, but will still take affect when parameters are used.  You can unset the parameter, check it, and re-assign the parameter.

    However, the "Recalculate pathfinding?" option only appears in the Object: Teleport Action.  You hadn't mentioned this before - what is your complete ActionList, properties included?

    If you're just using the teleport Action to place the NPCs after spawning, try instead using the "Relative to" option in Object: Add or remove.
  • edited February 2018
    Thanks for your response!  I'll revisit this soon.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.