Hi all, I’m having some issues with some badly behaved children…
I have a parent blueprint that has a bool that is set to 0 as default.
Within Child 1’s blueprint after being called, an Event Dispatch is sent that is received by the parent. At the end of a sequence within the parent it gets/sets the bool (The bool is called ‘1-1-4’) to true, then Child 1 moves on to do another sequence by way of a branch once interacted with again. The bool is definitely switched and it is confirmed in a debug hud I have set up.
Now that the bool is set to 1 and confirmed, I then interact with Child 2 expecting to see the true statement of Child 2’s bool branch (is bool ‘1-1-4’ true), instead the debug hud reverts to show the bool as 0 and Child 2 runs the sequence associated with false. Hmm, strange!
To add to the strangeness, I go back to Child 1 and reinteract. The bool/debug are shown as 1 again and Child 1 is still following the true statement of my branch.etc.
So it is as if both children have separate instances of the parent bool even though both set/get it within the parent.
My main question is, is this normal parent/child behavior to have individual instances of the same variables? If so is there a good way of sharing variables between children aside from casting to each child? I’m attempting to use a parent/child relationship to manage NPC’s and dialogue.
Here are some redacted (but large. Open in new window for full size) blueprints incase they may help. The more I think about it the more I think that there is something wrong in the blueprint. Excuse the mess and inefficiency, it is still a work in progress!
Parent - with Event Dispatchers holding the dialogue tree’s so I can keep an eye on the bool with my Debug hud more efficiently. Dialogue Answer 1 of the lower two Dialogue Answers sets the bool ‘1-1-4’ to true, upper two can’t access the same bool result.
Child - receives call from parent, sets dialogue name variable, sprites when interacting.etc then sends a message to parent to begin the appropriate dialogue tree.
Player Controller - Checks if object hit by line trace is ParentNPCHandler (Parent - Image#1)