I am working on a prototype magic system for a later project and am facing an issue I haven’t been able to resolve. To explain, I have a parent class called ‘BaseMagic’ which is an actor and contains some setters and getters, and to create the “spells” I created child classes that added specific functionality such as projectile components etc. In the C++ file for my main character, there is an attack function that plays a montage for that attack which contains anim notifies used to call a CastSpell() funciton.
The issue I am having is trying to switch between montages based on the spell equipped. I store the spell that should be spawned using a TSubclass but am unsure of how to implement a way to detect which type of spell is equipped and therefore which montage should be played. I have included images of code relevant to the issue. If there is a better way to try and achieve what I am doing please let me know, I am rather new to UE4, but as much as possible I want to keep it to C++. Let me know if there is any other info that would be helpful, I’ll answer the best I can.
Project files - Album on Imgur - project file links