I have a weapon system, and a base Weapon Actor Component Class
I use this base class to store an array of weapons on the pawn, however, I am running into the issue where I get the referecce to the weapon, but since the variable is of parent class, I cannot get the child class to execute over ridden function - without casting to the child class first
I want to be able to call a function all weapons will have (Fire Weapon) but each weapon needs custom code to run depending on weapon type.
I tried using reference to self on the weapon actor component and casting to the child class and cast would fail? I thought I have done this before and I was able to cast to a child class on the parent class using a self reference, perhaps my memory is incorrect and this is not possible?
I tried using Blueprint Interface (Created Weapon Interface, assigned interface in parent class), but it still, when using a reference to the parent class or used inside the parent class blueprint, if the interface event is called, it only runs on the parent class.
I have also tried an event dispatcher, and that will not call any code on the child class
I really need to be able to run a function on a child blueprint when I only have reference to that child object as the parent class? I would have thought an interface would be the solution, but I guess I still have to cast to the appropriate class?
Should any of these attempts work for what I am trying to do and I am doing something wrong, or am I trying to go about this the wrong way?