This does not seem right though. You can tell I am confused with the definition of the enumeration because I used them for years without knowing what they fundementally are.
An enumeration is a complete, ordered listing of all the items in a collection. … The term is commonly used in mathematics and computer science to refer to a listing of all of the elements of a set.
I found this when looking into the definition behind the word and I think it makes sense. Most Enums are used to define pre-made constants. But I don’t really know what they truley are, this is just a guess.
That allows you to do Enum.HumanoidRigType.R15.Value and get 1 or Enum.HumanoidRigType.R15.Name and get “R15”. Enums are Enums, not tables or anything else. It’s like an Instance; it’s just a Roblox thing.
From what I understand, Enumerations are a form of a dictionary in a sense.
When calling something like Enum.HumanoidRigType.R15, it doesn’t make sense to store to a variable “R15” or “RigTypeR15”, so the variable stored is an integer to separate out the indexes (R15 and R6).
When coding in other languages, such as C++, I typically specify Enumerations quite often for different states. Normally do so similarly to this:
This example would be used in a module script, but can be modified to your use case.
The differentiation occurs with the use of the index, but any complicated math applied will use the integer specified, because it just doesn’t make sense to use the alternative.
This also explains why you can determine priority levels with the AnimationPriority Enum.