Launch a Blueprint Widget from C++ code
I am looking to launch a Blueprint Widget with a custom class (followed this tutorial) from my C++ code -- specifically when the player is facing an item, and presses a 'Use' key the Widget pops up -- but cannot seem to get this to work.
I have already Googled extensively for the answer (ie here and here seemed like the should work but didn't) and haven't been able to find something that works for me yet, any help would be greatly appreciated.
asked Jul 02 '15 at 09:35 PM in C++ Programming
Easiest and quite comftible to use (since it creates some soft of interface) way to for bidriectional BP and C++ communication, is to create C++ base class with things you want to have in C++ and then make blueprint that based of it
So create new class based of UUserWidget, put property variables for widgets you want to control, now create widget BP based of that class or change existing BP class in "Blueprint Settings". After that go to defaults of BP and set variables you made with widgets that you placed in that BP. Now you can get current user widget that is displayed in viewport and control widget in it via variables you made.
answered Jul 02 '15 at 11:52 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here