Basically I have pickups in my level which implement MyInterface. If the player picks them up I want to spawn a corresponding Widget (InventorySlot) in my hud. MyInterface has methods to retrieve the pickup name, inventory image and so on, so the spawned widget needs a reference to the item
No, I’m not trying to apply the interface to a blueprint
As you can see in the image, passing the interface in the “On spawn” pin generates the compile error, but setting the interface directly doesn’t. Both ways should behave the same way (as it does for other engine classes like Vector, Actors etc. - those behave in both ways the same and can be passed via the “on spawn” pin and direct set)
Instead of passing in a variable of the interface, in you apply the interface to the widget blueprint you will then be able to use that interface within that widget. I believe that this will accomplish the goals that you are trying to meet. I have link the documentation on interfaces. I hope that this information helps.
I know how interfaces work, thanks
I want to pass a reference to a class inheriting from MyInterface to another class on spawn. It is working if I set the interface via direct “setter”.
It is working for other classes and structs in blueprints (
I was able to reproduce this issue on our end. I have written up a report (UE-24222) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.