I currently have a couple of projects which are filling up with boolean variables and I was wondering If I can replace these with Enums?
For example, I have a character that can cast different spells, each with a booleon value set to true or false if in a ‘casting’ state. Each casting state has different animations assigned to it and the BP graph and anim BP’s are starting to get a bit messy.
If I create a Enum with a list of all the different casting states can I then collapse my individual ‘spells’ codes to functions. Then my character blueprint could be simplified to 'if input action 1 is pressed, set enum to ‘magic ability one’ which could then trigger the desired function and switch back when completed?
I also am working on some parkour movement on a seperate project where it would be really useful to link various values to my enum so that they can be called easily in an animation statemachine / potentially better option I don’t yet know about.
If so, is there any way of checking if an enum is active in a animation blueprint and then playing the corresponding animation? This could really clear up my state machine and allow for more complex / additional transitions.
Ideally I could then have Idle -> Walking/Running -> ParkourMovement rather than what will quickly turn into a mess in my example:
I’ve tried looking for solutions online but the basic enum tutorials just show you how to create a list, rather than assigning specific values (such as a booleon) to the items on the list. I’m sure there’s a better solution than what I’m doing but don’t really know what to look for.
Thanks in advance for any help.