I am working on a game where when you click E you use an ability. You can change this ability by picking up pickups around the map you get from killing enemies. The way I
set it up now is when you pickup an item it changes the variable “CurentSpecialAbility” in the Character BP and then when the player clicks the special ability input it runs a bunch of branches to see if the current special ability variable matches to see what code to run. This seems horribly inefficient though. There has to be a better way but I just don’t know what to type here to get an answer on what the best practice would be. Any help would be awesome, thanks
I would use Switch on Name
. That’s all
Real oneeee, thank you
would recommend that the pickup gives you the ability and then you just execute the ability you have atm,
if you use the unreal ability system you can do that with by granting and removing abilities, if you want to roll your own ability system, make a base ability class with a base function you can override in specific abilities.
if you format your abilities like this you can easiliy add new ones without every time needing to update your character
How would you go about overwriting the function & giving it to the input on your player character exactly? That’s the part I’m most confused about. Thanks again.
I would do something like this. Gameplay ability system is also an option but it’s a big can of worms to open.
Short example of how to make it yourself. Renamed Ability to Action, so that people don’t confuse it with the unreal ability system.
The concept is easier to use than to explain
Thank you man this is a way more modular way of doing things. This is perfect!