Enums and structures are generally used for organizing and consolidation, enums are useful as en example, in naming a series of states such as AIEnum: Safe, Caution, Danger. While you could use an integer, it’s easier to use a custom named enum so you simply use Caution instead of having to remember Index 1 is for caution. It’s also nice for organizing things like weapons, e.g. I use an enum for weapon types which I use to check conditions, such as WeaponType: Pistol, Shotgun, Rifle, Rocketlauncher, etc. You can also read the enum name and output it to a string which is useful as well.
Structures can literally be used for anything to make your life and organization easier in handling data. A vector3 is simply a structure of 3 floats. I also use structures as an example in weapon data. So I’ll Have a WeaponStructure containing Enum WeaponType, float AmmoInventory, float AmmoCountInMag, bool IsInfiniteAmmo, float DamageToGive, float RandVarationInDamage, etc. You could then make a structure of your structure if you’d like, so Structure PlayerData would contain float Health, transform ActorTransform (which transform is an included struct of the structs rot, vector3, etc.), WeaponInventory (An array of WeaponType), etc.
Super useful when doing things like constantly needing a collection of data at once in a function, storing/saving data, doing loops, etc.
One thing to note for blueprint Enums is there is I believe a limit of 256ish entries, while the blueprint enum editor will let you add more, it’ll actually forget/loop back to index 0 of an enum for any values higher than the hardcoded limit, though I think you can use unlimited enum entries in C++. Learned that the hard way when I sillily manually entered an enum of 1000 names only to find out the first 256 was all that it would read. Problem solved for that particular situation (making NPCs have random names from a list) by reading a csv datatable. As long as you don’t need over 256 specifically named items in one enum, you’re good to go.
Enums are also nice in using the switch node to create a readable flow of your graph, instead of using a bunch of if/else boolean checks, such as shown in my included image.
Here it’s used basically as a human-readable integer that determines which action my AI should take upon the binded event of Movement Completed. Caution being to move towards a random point around the sound they heard and moved to already in order to create a search radius, Hostile meaning the AI is directly engaging an enemy and so will instead just keep moving to a random point around itself once it reached the last point/had stopped moving.