I’m making a drag-and-drop menu as a Widget Blueprint. I’ve been prototyping the simple stuff with blueprints, but I’ve got to the point where I’m going to need to work in C++. I’m not sure how to do this though.
When I’ve done this with Actors, I’ve done it by creating a AActorComponent C++ class and calling its functions from the Actor blueprint. However, widget blueprints don’t seem to have a WidgetComponent class. I basically want to make a c++ class with some helpful functions (e.g. an OnDrop function that checks where in the vertical box of children the user has dropped a widget and places it appropriately). What’s the correct way of doing this with widgets?
Is the answer that the C++ class needs to be added to the player controller? This doesn’t seem to fit with the hierarchy to me, as the C++ class is only interacting with the widget. Surely, it should belong to the widget?
It may be I’m doing this in completely the wrong way, just going on what I’ve done and been advised before when working with actors.