Specifying default abilities in code

bf1081

New member
Hey,

Just want to say thank for the help before, it totally worked.

I have a new question now though (somewhat similar).

I am now trying to add multiple generic "Speed Change" abilities to the character's locomotion script.

I went through the documentation and noticed that I can enable and disable them via script.

I am trying to add a shop system that allows the player to have different tiers of sprint abilities.

I can disable to default speed change ability easily, but I am struggling to figure out a way to specify which "Speed Change" ability to enable.

What might the syntax be to specify which ability I'm altering?

var characterLocomotion = Player.GetComponent<UltimateCharacterLocomotion>();
var swiftAbility = characterLocomotion.GetAbility<SpeedChange>();

Something like characterLocomotion.GetAbility<"""SpeedChange1, 2, 3 ,etc""">(); would be perfect.
 
On the GetAbility method you can specify an index - this is the index within the ability list and can be used to get a specific ability out of multiple. You could also use GetAbilities and loop through to find the correct one.
 
Top