Forum rules - please read before posting.

A Few things I don't Understand (Unity Nav Mesh and Action Lists)

There are a few things I'm having trouble with, but in this thread, I have picked two that I'm running into problems with early in development.

First- Unity Nav Meshes. I baked a Nav Mesh using the Unity tools. I set player detection to Use Unity Nav Meshes, yet my player walks up the highest slopes and various terrain. Is there something simple that I should be doing to fix this?

Second- Action Lists, in general. Can I make an empty object and just assign an action list to it? I understand a hotspot has it's own list, as does a cut scene and a trigger. But what if I want to hide a UI element at a certain point, restrict player movement, or add an item to an inventory WITHOUT interacting. Action Lists strike me as needing player input of some kind to begin the process of executing a behavior. What if I simply want something to happen when a scene loads, or just occur in the background as a parallel process?

Comments

  • Unity NavMeshes
    You don't want your NavMesh to cover areas the player shouldn't be able to move along.  You should be able to configure the shape by tweaking the settings in the Navigation window, but this is more of a Unity issue than an AC one.

    Alternatively, you could switch to Mesh Collider pathfinding, which would allow you to define the exact area as a custom mesh.  Scripts are available via Google to export your Terrain as a mesh that can be opened in a modelling package e.g. Blender.

    Action Lists
    If you want to have a general sequence of Actions that can be called upon at any time, use either Cutscenes of ActionList Assets.  If you want a Cutscene to run when a scene loads, you can assign it at the top of the Scene Manager.

    Otherwise, any Cutscene or ActionList asset can be run by calling its Interact function.  This can be done via a custom script, or by using the ActionList: Run Action.  This Action can be placed in any other ActionList, which can also be part of a Trigger - which runs when the player or some other object passes through it.

    ActionLists also have a When running property at the top, which can be set to Run In Background - essentially causing them to run as a background process, as you've described.  If the last Action in an ActionList skips back to the first, the list will run indefinitely until it's stopped with the ActionList: Kill Action.
  • edited August 2016
    It's also fair to note NavMeshes are only meant for path finding, meaning that if you are using Direct Control as your movement method the Navmeshes will be ignored. If, in such cases, you need to set limitations to the player's movement, then you'd need to either use Colliders to block their path in the level or modify the player controller.
  • Thank you for help and feedback. I am using direct control. I went back into the manual and saw that I can't use a Navmesh. I was trying to bake Unity's Navmesh and expecting my player to use it. I already knew about setting up the colliders, but it takes some time to get right; I mistakenly thought switching to Unity's built in-system was supported if the control was Direct.

    I know this is a newbie question, but I'm still stuck on action lists. NOT how they work, but how and when they can be used. For example, I want my player to Run by default when I start a level. I was going to set up my parallel processes per scene, such as invoking weather or if my player walks or runs... Not using a cutscene, but instead, an empty game object that serves as a manager. Can I attach an action list(script) to the empty object, and then expect it to just run when the scene is loaded?

    Am I making sense? Maybe my question is so basic that it doesn't seem like I should be asking it, but I think I'm just having an issue moving from my programming and organizing process to the one AC offers, and what I'm trying to do is counter-productive.
  • And I am going to post again to ask a third question, directed specifically at you Chris. I appreciate your support, so hopefully, you find the time to again answer this question.
    When you explain running a sequence of events, you suggest doing it from a cut scene. I have been thinking about cuts scenes as literal cut scenes; I want to interrupt the game to change the camera and throw in some dialog, for example. But I'm starting to think that you may be trying to point out the fact that a cut scene is essentially a vehicle for controlling a series of actions. Often it is interrupting the gameplay to add an event, take a count, change a state, ect.. But you're suggesting that I use a cut scene to command background processes?
    If so, do I just create it and it can run without relying on a preceding event? If the very fist event that I want to load in my scene, for the sake of illustration, is for a light on a cube to turn from green to red, are you saying to make a cut scene and have it run as a parallel process/in-background, so that the event will occur within the scripted timeframe?
  • edited August 2016
    Hi! Don't feel about having questions, that's how we learn faster anyways, by asking stuff (or reading stuff, lol). 

    About the first question AC already has a solution for that. Each scene has it's own On start, on load and On variable change cutscene/actionlist slot (there's also one for when the game starts in the Settings Manager). You can slot in actionlists there to activate them at specific times. If I remember well, On start is for when a scene loads, Onload is for when it is loaded from another scene and on variable change is self explanatory. Still, I'd check the manual or the tutorials to verify (I'm not at home right now so I can't check, and I mostly only use OnStart).

    Now, about the cutscene thing, I must admit when I started it made me have the same question. But really, cutscenes are just actionlists that "live" in a scene. And actionlists are in essence just a block of visual scripting. There's also actionlist assets, which are the same thing, but they exist as assets, so they're reusable and can be used in any scene. Now, about having an actionlist running permanently in the background. Well that's not hard to do, if you know programming you probably know how useful loops can be, and to make one in AC all you have to do is use an Actionlist where the last action loops back to the first action. Just make sure you make a way out of the loop (That is, unless you want it to always run as you said.) But if what you mean is to just to have an actionlist run without pausing/blocking gameplay, all you have to do is click your cutscene/actionlist, go to the inspector and look for an option titled When running then choose from the dropdown the option Run in Background. That way the actionlist won't interrupt gameplay while running.
  • Thank you @Alverik.  Yes, exactly - the naming convention regarding Cutscene is admittedly a little misleading, brought on by the fact that the ability to run them as a background process was introduced after they were.  But they can be used to run any sequence of Actions within a scene, whereas ActionList Assets do the same but from an asset file - allowing you to call them "globally", i.e. from any scene.

    To run when the scene begins, you must have it run as part of the OnStart Cutscene in the Scene Manager.  This is to allow you to differentiate what gets run when the scene begins via player-directed entry vs due to loading a save game.

    If you want multiple Cutscenes to run at once, you can use the ActionList: Run in parallel Action to create as many branching paths as you like.
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.