I'm using a dynamic "move to point" hotspot so that unhandled interactions can have the player walk to them first before the dialogue telling the player the hotspot it can't be used:
Unfortunately, if the "walk to" is cancelled before reaching the hotspot, the player will still say the line of dialogue. Is there a way of forcing the whole actionlist to be cancelled if the walk to is intercepted?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You can hook into the OnCharacterEndPath custom event to kill the ActionList asset:
I just added this as a script on my custom scene scripts objects, and if I cancel an unhandled interaction, the character still speaks, is this script meant to work for all actionlists, even unhandled ones?
It should kick in for whatever ActionList asset you assign in its Inspector. Try placing in a Debug.Log statement above the KillAllInstances line, i.e.:
Would I need to modify the script so it cancels any actionlist that's running? It wouldn't be for one particular actionlist, rather for all of the unhandled actionlists that don't kill the whole list when it's cancelled by clicking away.
For multiple ActionLists, you can rely on an array instead:
Adding the unhandled open actionlist in the array cancels the actionlist when the player reaches the door and doesn't play the "I can't open that" dialogue. Should it be cancelling prematurely?
Ah, I was being stupid. This will cancel the ActionLists whenever the Player stops moving, even if it's part of the original interaction.
Let's try hooking into OnCharacterSetPath to record the player's destination. If he's not within a certain distance from it when the path ends, it should be safe to assume it's been cancelled:
I'm using it with Close_Unhandled_Interaction and no matter what distance I set, it still plays the dialogue if action is cancelled. What method is used to cancel "walk to marker" interactions? In the case of unhandled interactions, the use of move to (hotspot) point is necessary because "walk to marker" can't be used for unhandled interactions (since they haven't been set anywhere) could there be a way to use "walk to marker" for all unhandled interactions before the "i can't close/open/use that" dialogue in the unhandled actionlist is shown?. If not, is there some reason this distance float isn't working as intended?
Perhaps this is the wrong approach.
I shall consider.
Thank you so much, it would be greatly appreciated! That way all interactions can be handled similarly and I can keep unhandled actionlists just containing the "I can't do that" dialogue and the sentence would hopefully stick during the "walk to" as it does with handled interactions.