First, the parameters. I have a parent “RangedWeapon” and a child “LobWeapon”. Within some other blueprint is a reference to LobWeapon that is cast as a RangedWeapon.
When a function is called within RangedWeapon from the some other blueprint, how can I fire an event/function on the child, somewhat similar to something like an override to “OnWeaponFired” or “OnPlayerLanded”? My knowledge on inheritance is a little rusty.
I swear I’ve done this before, and forgot about it in a long hiatus from UE4.
Turns out that staying up for three days straight turns you into an idiot. I figured out I can just test this with a minute of work, but I’ll leave this up for anyone else with the problem I had. When you call a function “A” that afterwards calls a function “B”, just override the function “B” in your child blueprint. Now your parent blueprint calls the override B function in your child.
It’s been a while since I’ve touched BP and not at a UE4-accessible station, but on the panel with your variables and functions I believe there is a dropdown arrow where you can override parent functions and events.
Just make sure the Custom Event has the exact same name in both the parent and the child. That way, when the Parent calls the Event, it’s called in the Child.
In the example, the Parent is callled “Is_On_Fire” at the end of a sequence of checks for my burnable objects. This then triggers the “Is_On_Fire” event in the Child to set the particle effect from “hidden” to “visible”.