So I’m making a sorting game and I want to have an interaction with items where I can choose a specific box for them. You see, there is, for example, a plastic bottle. When I interact with it, I can see some widget buttons such as ‘plastic’, ‘metal’, etc. There are also boxes with chosen enum variable and I want that bottle (after clicking on the ‘plastic’ button) to fly into this ‘plastic’ box. How can I connect that bottle with the enum variable in the box? How that bottle can locate the proper box on the stage?
First of all, every box and every item should know its enum value and should keep it in some UPROPERTY. After that you can use GetAllActorsOfClass, GetAllActorsWithInterface or GetAllActorsWithTag from Blueprint, or just TActorIterator from C++ to iterate through scene actors collection and find out the one you are searching…