I have a number of spots in my game where I would like an action to run if the player clicks, or automatically after a short period of time has elapsed.
I'm looking to create the following effects:
I've tried a couple of setups, such as:
Approach 1:
-Action List Run Simultaneously
1: Wait (x seconds)
2: Input check - single click (looped)
-> Both lead to
- Next action
Results: Advances to Next Action after time has elapsed or the user clicks, however, the looped input check continues to run, and executes Next Action the next time the user clicks. This is particularly weird in a cutscene which has two of these sequences.
Approach 2:
-Action List Run Simultaneously
1: Action List Run: (separate list that runs a wait, and then the desired action - a dialogue that says "click to continue" for instance)
2: Input check - single click (looped)
-> 2 leads to an action list:kill (action started in 1) and then into the rest of the action list.
Results: The action list triggered in 1 runs regardless of the kill in 2.
Does anyone have any experience with this kind of actionlist?
Good luck with your projects in the new year!
-M-
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Running the Input: Check Action on a loop isn't reliable enough - for that reason, it's since been superseded by the Active Input system.
Active Inputs allow you to run an ActionList upon detecting input. You can set one up to be disabled by default, and then use the Input: Toggle active Action to enable it when you want input to be detected.
Triggering an Active Input will cause its own ActionList asset to be run, which you can use to both run the next ActionList that advances the conversation (ActionList: Run), and kill the ActionList that prompts the Player (ActionList: Kill).
Try it with just one scenario, where you run/kill a fixed set of ActionLists each time the Active Input is invoked.
To have it then work for multiple scenarios, you can parameterise the Active Input's Actions with GameObject parameters in place of the ActionLists you wish to run/kill. Then, before enabling the Active Input, use an ActionList: Run Action with a Method set to Set Parameters Only to set the parameter values to match the ActionLists you wish the Active Input to later affect.