Well it is a widget inside a layout, and I’m creating the layout inside the PC, but I’m unable to cast from this specific widget… I have already succeeded to make it work but through an interface I’m posting the my own answer now, but I’m still interested to some other proper way ^^
Created an Interface and attached it to ControllerBP
Added 2 boolean outputs (ZoomIn & ZoomOut) to the Interface
Created those very same booleans on ControllerBP and setted them to the input buttons keys
On the widget created a get player controller node and called that very same Interface (message) reference from it
Then I was able to finally get that info to the widget and made it to work on the Event Tick with some Branches and well placed good ol’ DoOnces !
Was really hoping to do this with my way but I was unable to reach it event through event dispachers… But it’s working now anyway, if you’re reading this, please don’t abstain to comment if there’s a better approach !
How do I properly cast a widget blueprint custom event inside a widget that is inside another widget (As a layout) ? seems that I can’t set this up…
I have a minimap, and there are 2 working buttons for zooming in and out, I’m setting up the numpad’s keys + and - in player controller to then call the widget custom events to do the thing… Tried to cast the widget inside the widget layout failing the cast, tried all kind of casting to everything and nothing seems to work
How do I properly do this? Which is the best approach for this?
Mmmh, yes the problem is that the widgets are not the same type, they are different widgets ! That’s why I need to cast them, I understand now the difference of call and cast my friend thanks for that !
I was trying to cast directly the minimap but I needed to cast to Example Layout 5 firstface palm xD
That was much appreciated my man, will mark your answer ^^ thank you !! ■■■■ it, those things happens when you have given too much hours on the same problem…
If you create the widget in the PC and store the reference of the correct type (right click the Return Value pin of the Create Widget node and Promote To Variable to automate this process), there is no need to cast.
But perhaps you’re storing just a generic Widget reference to swap different layouts, each being another widget. In that case, you’d need to cast, of course. Or use the interface.
My answer to this comment is waiting
moderation and I don’t know why xD
Happens, when you (s)hit a blacklisted word, for example.