Hi guys i'm trying to have the character walk to point on look at and then say something, if i use move to point without wait until finish he talks duting walk, if i check it the game goes in block and i have to wait until the action it's finished without have the possibility to click somewhere to cancel it. Is there a way to do that?
p.s. i noticed that it works fine adding the marker in the inspector but i'm wondering how to do the same things in the actionlisteditor
Comments
When is this all supposed to occur, when clicking a Hotspot? The Hotspot Inspector's "Cutscene while moving?" options are there to allow you to cancel the interaction by clicking elsewhere before the player reaches the provided Walk-to Marker.
One thing you could try is separate the Actions, so that you have the walking behaviour in a background ActionList, and the talking in a separate blocking one. (An ActionList's "When running" field lets you choose between those options).
The "talking" ActionList (basically everything that occurs once he's reached the destination) could be placed in a Trigger that checks if the "walking" ActionList is currently running. Place the Trigger at the destination, so that if the player enters it - and the walking ActionList is running - then stop the player from moving and have him say his line.
However, you can separate the response into two ActionList assets. The first causes the player to move to the given point, and its When running field is set to Run In Background. Check Wait until finish? in the Character: Move to point Action, and then have it run the second ActionList asset that gives the response. (This second one should block gameplay).
You can then make use of a simple script to stop the first ActionList if you click while the player is moving during gameplay:
using UnityEngine;
using System.Collections;
using AC;
public class StopMovingTest : MonoBehaviour
{
public ActionListAsset[] assetsToEnd;
void Update ()
{
if (Input.GetMouseButtonDown (0) && KickStarter.player.IsPathfinding () && KickStarter.stateHandler.IsInGameplay ())
{
foreach (ActionListAsset assetToEnd in assetsToEnd)
{
KickStarter.actionListAssetManager.EndAssetList (assetToEnd);
}
}
}
}
Paste that into a new C# script named StopMovingTest and add it to your scene. Then assign the background ActionList assets (the first one of each pair) to the Inspector, and they'll be forced off when the mouse clicks while the player walks to his destination.