Equip weapon with two buttons being pressed.

Somosky

Member
Hi. I've created 3 abilities. 1 were if you press Y on the XBOX Controller you cycle through three guns. If you press the LB on the controller a melee weapon is equipped and if you press RB a magic weapon is equipped. I'm attempting to create a 4th ability where if I press RB and LB at the same time a different weapon is equipped. Is this something that I'd be able to do with UCC? I can't seem to figure out how this can be done.
 
Unfortunately Unity's Input Manager (which is what UCC uses to handle player input) doesn't allow for multiple keys to be assigned to a single input value. However there are a couple of ways you can go about this:

The demo scene contains a custom ability starter called "Combo Timeout" (this is used for the "special attack" in the demo scene). You could set up your ability to use this starter type and assign the two input values, with a small timeout value to give the player some leeway (probably around 0.2). The only caveat with this is that the order of the input value names determines the order the player must press them, so you'd have to create two identical abilities, where one has the inputs listed in the order of Input A, Input B, whilst the second ability has them in the reverse order (Input B, Input A). This page describes custom ability starters in a little more detail.

You can also manually call abilities using the TryStartAbility as described on this page. You could have a custom script that calls it when any combination of inputs is detected.
 
Top