Suppose I have a widget called ‘Child_Widget’ which is a canvas panel containing a button. I then place a few of these inside another called ‘Parent_Widget’, but they might be nested in several layers in the hierarchy - inside a horizontal box, which is inside a scale box, which is inside a canvas panel, for example.
And suppose the ‘Parent_Widget’ contains a function called ‘Parent_Function’.
On BeginPlay, I want the button inside ‘Child_Widget’ to contain a reference to ‘Parent_Widget’ so that OnClick it can call 'Parent_Widget’s ‘Parent_Function’ - what is the correct way to do this?
I have tried using (on ‘Child_Widget’) the Get Parent node and then casting the result as a ‘Parent_Widget’ but the cast fails.