So… You want to keep track of attributes that different object classes can hold. Let’s say a box, a spoon, a car, a boulder, and a animal, correct?
And then… Perform math operations on the different objects while accessing these attributes, yes?
Sounds like an object/message oriented programming approach. Look into OOP methodology since Unreal allows object or class based approaches if your not familiar with them already.
Keeping track of attributes that different object have can br done with a structure. Each object could have this structure stored in it - it could be a custom made component blueprint that holds it. This way you can ask if the object in question has this component.
Likewise, the component could also perform the math operations, this depends on your needs, since it works with the attributes in question. Several alternatives:
- Macro - define your macro functions in a library, accessible by any other actor
- Blueprint Interfaces - these pass information between objects, they don’t let you perform functions though. This is one of three methods of blueprint communication.
- Singleton - where you always have an object in the level/application that can be accessed to perform your functions.
Some of the other pros here may have other solutions.