Hi everyone, This is my first post. Just a few days in to AC so probably just a noob problem, sorry in advance. My question is is it possible to trigger an action after a character has stopped moving? I am looking for my player (in 3d) to look forward every time they come to a stop.
Also just to say AC is the answer to all my dreams, I wish I has tried this years ago...
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I found a way of kind of getting the effect i want, I have a cutscene where i'm making the player face forwards and i have a actionlist on start game that is set to run the face forwards cutscene and then wait 3 seconds and is looping around its self. When i tap to walk I more often than not will face forwards but the only downside is that it some times stops me when i'm walking a long distance. I'll keep at it. Any advice would be welcome as I'm sure there is a better way:)
Ideally I also want to be able to stop it in certain instances, at the start of a scene, interacting with something and any time in general.
Welcome to the community, @SuperCoolEmile.
I recommend staying away from "looping" ActionLists when possible, as it adds complications when loading save games in particular.
What you can do here, however, is hook into the OnCharacterEndPath event to trigger your ActionList. Custom events are a way of extending AC through script, and this particular one is run whenever a character stops pathfinding.
Here's an example script:
Paste that in a C# file named "RunCutsceneOnEndPath.cs", place it on an empty GameObject in your scene, and assign a Cutscene that makes the Player face the way you want. Optionally, you can replace "Cutscene" with "ActionListAsset" to have it run an asset file that you can call from any scene.
Super cool! This is great thanks
This does exactly what I need. I'll look more into custom events as feels like a fun place to know.
Thanks again, i'll stay away from those looping action lists going forwards:)
Also thanks for AC, i only learnt about this recently, its pretty much all i've needed for the last year and didn't know. Its giving me a lot of freedom