Trying to wrap my head around interfaces:
I made an IActivateable
BP interface with a single function, Activate
.
I’ve got a Button
blueprint that has a publicly editable variable called Targets
of an array of IActivateable
, and when the Button
is triggered it foreaches over the array and calls Activate
on each item.
I’ve got a LightFixture
blueprint that implements IActivateable
, responds to the Activate
event by toggling a pointlight component’s intensity.
I drag a Button
and a LightFixture
into my level. I select the Button
and see Targets
is empty. I click the + and get no options for possible selections. Shouldn’t my LightFixture
instance appear? If I change the type of my Targets
array to LightFixture
it pops right up.
What am I misunderstanding here? I thought the point of interfaces was polymorphism? From looking at tutorials it looks like every use of BP interfaces involves a cast attempt on a generic object