wizardpoop
Member
@Justin I have some abilities that share base classes or otherwise can extend another (Glide -> Fly for example). If I then use
This is when I looked more closely into the various
My questions are:
m_CharacterLocomotion.GetAbility<Glide>()
I can end up with a superclass variant (Fly) as opposed to the target subclass which ultimately leads to an error.This is when I looked more closely into the various
GetAbility|ies()
overloads and specifically abilityIndex
and Index
. I thought the former was designed to handle my exact situation (after searching the forum and reading the docs), but after testing the change, it still didn't work. I then looked at the source only to find that Index
was instead the identifier being used in the GetAbility<T>(int index)
overload body. When I manually set Index
however, it fixed my error, but the functionality I was after broke. I then learned that the Index
refers to the priority index within the controller.My questions are:
- What is the preferred way to call
GetAbility<T>()
or any of its overloads when abilities can inherit? - What are the intended uses for the
abilityIndex
? - If
Index
is intended to be the priority index within the controller, then why is it public and mutable? I'd otherwise assume the Abilities stack order naturally defines this priority? - Am I missing something obvious or misunderstanding something with respect to abilities?