I’m trying to abstract the behavior of a switch into a C++&Blueprint base class, InteractableActor, so I can then inherit and create various objects that use that behavior. A concept that I handle is that of a switch that only shows two states, and a basic behavior is to change the image that it shows when it changes state. At first I tried using UPaperSprite, and the SetSprite function didn’t work. Change to PaperFlipbookComponent, to manually set the frame to display, statically, without rendering the flipbook, just displaying the frame. And exactly the same thing happens.
And what happens is that although I can set which frame to show, or which sprite to show, when I generate the object, even in Construction Script, in the case of Blueprint. After that, on execution nothing works that changes the image of the object. Neither SetSprite, which returns false, nor SetPlaybackPositionInFrame, which does nothing. But that line is running.
Information I can provide:
The class follows an inheritance of:
C++ - InteractableActor
Blueprint - BP_InteractableActor
Blueprint - BP_Button
I have tried moving the behavior between the derived class and the base class, but the result is the same. An example.
At the top left you can see how the debug text is output, so the execution goes where it should, but nothing happens.