Control character abilities sequentially

gurayg

New member
I'd like to ask how if there is such a helper component for such use. If there is not, any pointers into creating one.

What I need is a bit more than a "Move Towards Location" and a bit less than a cutscene editor.
I'd like use a trigger to start controlling character abilities sequentially until all abilities in a given sequence runs.
Example: Characters control is taken away from the Players.
Character runs to a location, then Interacts, then moves to another location, then looks at to a point and finally jumps.
After that short segment, Players gain control of the character and game plays normally.

AFAIK there is no such thing built-in. But I thought maybe I can at least get a starting point.
Look at those classes, events...use this Utility class or such.

I see that "OnAbilityActive" event seems to be a friend in such use.
or maybe a "ComboTimeout" like class that starts with a trigger and works without input from the player.
How do I even completely get control of the character for a duration and give it back with UCC?
Any other thing I should consider?

Thanks in advance
 
You're right in that there isn't anything built in for this.

Listening for the OnAbilityActive event will likely where you want to start. When that event fires it includes the ability that was activated or deactivated, and within your own class you can then determine if the next ability should be started. ComboTimeout is a very specific situation and I would not use it in this case.
 
Thank you Justin. I'll do that.
What about taking "control of the character" part of this?
Can you give any pointers for that.
How do I disable Player Input? disable all colliders? Reset gravity? Reset Animator?
 
Hello @gurayg , allow me to recommend you Adventure Creator, which is literally the best asset on the UAS in my eyes, and quite fitting for what you're trying to achieve. It comes with an Action List feature which is basically a generic visual scripting editor that can be used both for simple sequences of events and full-fledged cutscenes. It also has an integration with UCC which you can find on AC's download page. This integration contains an ability called "AC_Motion" that takes control away from the player when an AC Action List not marked as Running In Background is activated, and an example in the demo scene of a player character moving from point A to point B during a cutscene.

If you do integrate AC to your project you will need to write a custom AC task to execute UCC abilities, but if you take the time to properly learn AC and know the basics of programming you should be able to handle that. Btw in addition to using OnAbilityActive, you can simply check if a specific Ability is active every AC action update. Here is also one simple example of the combination of AC and UCC in my own project, here the NPC on the left says a line, move to a point and subdues an enemy. I could also have forced the player character to do the same.


Lastly to answer your last questions, the "OnEnableGameplayInput" event allows you to disable Player Input, you can find an example on the Input documentation page. There's no built-in function to disable all colliders in UCC's code as far as I know, you'll have to do that yourself through code. For gravity the CharacterLocomotion script contains the m_UseGravity, m_AllowUseGravity and m_ForceUseGravity bools. Use Gravity is displayed in the Physics foldout in the Ultimate Character Locomotion component. For resetting the Animator I'm not 100% sure I understand what you want, UCC's demo animator logic works overall well and if your character stops moving abruptly or starts another ability the transitions will take care of everything. I do think there is a SnapAnimator bool parameter for several UCC functions which could be worth experimenting with.

Sorry for the long text, but I hope this was helpful and that you'll be interested in AC !
 
Hi @Cheo ,

Thank you for taking the time to answer.
I knew about AC but not the integration.
From the features you mentioned and by looking online it seems it is a good fit.
I'm going to give it a try.
and as for "Disabling Character Input" I wouldn't have guessed it was being done by sending an event.

Thank again, it was very helpful.
 
Back
Top