Forum rules - please read before posting.

Character won't walk to point

In the following flow chart, the spawned characters only SOMETIMES go to the point specified. Otherwise, they just stand there.

-There is a Nav mesh and characters are able to walk to other points.
-Point is not hovering
-Again character moves to other points, so there doesn't seem to be a problem with animator or rigid body.

Comments

  • Your ActionList references three separate characters instructed to move - which one(s) are affected?

    You have a few branches that might cause the ActionList to end prematurely if certain conditions aren't met - is it ending too soon, or is it hanging on a specific Action?

    If you keep the ActionList open at runtime, it'll highlight the currently-running Action in blue.

    If you click the cog icon to the top-right of an Action, you can attach a Comment to it. This Comment can be printed in the Console as the Action runs - just enable the Action comment logging field at the bottom of the Settings Manager.

    Use these to try to learn which Action(s) are being run, and which aren't.

    On a more general note: is the intent behind this logic to add other NPCs into the scene? An easier way to approach this is to convert them to AC Player characters, and then use AC's Player-switching feature to control them.

    When Player-switching is enabled, any Player listed in the Settings Manager can be controlled through Actions - even if that character isn't currently the "active" Player character. This includes moving to different scenes.

    A video and tutorial on this feature can be found here.

  • So there are two characters that spawn in. Zoe and Derek. Who gets spawned is random. Neither is playable so it doesn't make sense to switch characters.

    I rearranged the flowchart to where it now checks which character has been spawned. Then it does the actions provided. However, now, it gets hung up on an action if "wait until finished" is checked. I don't know why.

    For example it gets hung on moving Derek to DadPickUp (marker) because of this. If I uncheck "wait until finish" though it moves forward and stops at the player facing Derek for the same reason.

  • For example it gets hung on moving Derek to DadPickUp (marker) because of this.

    Hung as in they don't move anywhere? Are they on the NavMesh at the time, and how are they configured? Any screenshots you can share of their Inspector(s) will help explain the situation.

    There is a Nav mesh and characters are able to walk to other points.

    Is this to say that if you instead command Derek to move to a different Marker, then it works?

    Neither is playable so it doesn't make sense to switch characters.

    The Player-switching feature essentially allows AC to automate control over any character you define - whether they ultimately end up being a playable character or not. Rather than having to manually spawn and assign character prefabs in your Actions, such characters could be added to the scene via Player: Teleport inactive, and selected in Actions via drop-downs.

    Either way, if you're looking to run the same set of Actions on one of two possible characters, you can rely on ActionList parameters to avoid having to duplicate your Actions - instead just have one chain of Actions that affects a given "Character" GameObject parameter, and set that parameter's value beforehand.

    A tutorial on parameters can be found here.

  • I took a video of the Nav Mesh. Yes Derek can move to other points in other actionists.

    I included basically what I want to achieve through the video, as well.

    I am confused by the player switching, to be honest. If you watch the video above, does player switching still make sense? I also don't understand how parameters work. How will the parameter figure out which character to spawn?

    Sorry I am slow with this sort of thing, so could you describe further.

  • Derek can move to other points in other actionists.

    If you assign a different Marker in the problematic Action, does it work? We need to work out if the issue is with the character, or the Marker they're moving to.

    It seems like the character isn't being reported as having arrived, for some reason. Does it work it you check Retro-style movement? in the NPC Inspectors?

    If all else fails, you can check Enforce time limit? in the Character: Move to point Action to have a failsafe that causes the ActionList to continue if the Action hasn't been finished after a set time.

    I am confused by the player switching, to be honest. If you watch the video above, does player switching still make sense? I also don't understand how parameters work. How will the parameter figure out which character to spawn?

    Player-switching and parameters can both be applied here, either separately or together, but only as a convenience tool - you can continue to work as you are.

    With Player-switching, any character listed in the Settings Manager can be accessed via a drop-down once Is Player? is checked in an Action. You can also have AC handle the spawning of characters into a scene automatically with the Player: Teleport inactive Action, which lets you move any inactive Player listed in the Settings Manager to any scene.

    Parameters are generally most handy whenever you find yourself running multiple instances of the same Action (or chain of Actions), but with slightly different field values each time. With parameters, you can override Action fields with values yuo can set at runtime - meaning you can "recycle" the same set of Actions whenever you need.

    In your scenario, you have two chains of Actions - each instructing a given character (Derek or Zoe) to spawn in, move them, and have them and the Player face each other. With parameters, you could rely on a single chain and use a parameter override which character is affected by each Action.

    Exactly which parameter type you'd use would be down to using Player-switching or not. If you go without and keep things are you are now, you'd use a GameObject parameter to override your various "Character" fields in the Actions. If using Player-switching, you'd use an Integer parameter that represents the ID of the Player character to affect.

    You can set this parameter's value with the ActionList: Set parameter Action and checking Change own?. This'd be inserted after the Variable: Check Action that reads your "Which character" variable, so that any Actions that follow can rely on the parameter with its value set.

  • edited August 2022

    So, I added a brand new marker for them to go to, and again, Derek will go to it. However, if "wait until finished" is checked, the baby will not go to his point.

    I clicked on retro style of movement, and the baby still doesn't move to the point.

    Force time limit also doesn't work.

    Do you think this is being caused by Derek and Zoe being prefabs? Because I can try making them players and see if that works.

    Edit: So I made Derek and Zoe into players and it still doesn't work.

  • Also, I updated AC. Still doesn't work.

  • edited August 2022

    Whether the characters are Players over NPCs will have no bearing on the issue - I only mentioned that as a convenience for working with multiple characters in general.

    If you can PM me your project as a zip file and point me to the way to view the issue, I'll take a look directly.

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.