I have an overlap event in an actor class, and I want to play a widget animation when the player overlaps with a box component in that actor class. I tested it in bp and it seems that I need to cast to the widget class to access the function inside the widget which holds the code to play the widget animation. So how do I cast to a widget class in c++ i can’t find how-to anywhere. In Blueprints, there is a get all widgets of class but i can’t find it in C++.
You’ll probably need to create a c++ widget, reparent your existing widget to a c++ one and create blueprint callable function that allows you to call bp logic from c++. Wouldn’t be a bad idea to put your c++ widget inside a HUD and get a reference to widget in actor through HUD.