necro bump because this is a very useful thread even to this day.
i am beginning user and i was looking for aim offset methods and wasn’t even sure if i needed them. i came up with using an enumerator for selecting what blendspaces to layer over the top depending on what my character is holding, and now realizing i can use the exact value for my aim offset is grand.
the sub-animgraph linking also seems interesting but with my enumerator already set up it’s something i can pass on for now
The real way of doing this without loosing one’s mind would be to define everything within the weapon class, and then to instantiate it properly.
So, youd have a dedicated AO, a dedicated idle, etc/whatever the project calls for, that is a selecatable animation asset from within the exposed weapon parameters.
The rest, like implementing it and such, would be done over interface calls transmitting the needed parameters, such as the animations etc.
Its even possible to pass an entierly different ABP for the character to use when a weapon is equipped.
This is often useful for big things, like swapping from nothing to a spear that can naturally be used as a walking stick, since nearly all animations would change.
Fixed enums/etc are anything but elegant.
In fact, its how project end up dying or staying the same.
And sure, adding a bunch of stuff in a weapon class to control the thing using it can easily lead to overengeneering and too much thinkering for what is finally needed.
It depends on what you are acrually going for.
However, its likely the only real way to make a system that works based on the instance of the weapon you use.
Everything else (like enums) will at best be based on the Class of the weapon…
This is how we did weapons for our project. We created a class BP and then made instances based on the weapon that is possessed. The class contains 1st,3rd, and weapon animations as well as sound effects and special effects like muzzle flash and bullet hit decals. More or less any thing the weapon needs as far as resources is handled by the class which the main character animation BP can cast to. This way an unlimited number of weapons can be added. The flip side if your actors are class based you can add the weapons directly to the character base.