Say we have a Blueprint Interface “MyInterface” , which decalres an interface “InterfaceFunc1”. And it seems the “correct” way to use it is: link a “message” type function call, no matter the target implements “MyInterface” or not:
This is confusing from user’s aspect, especiall programmer. And this is what it should be from a programmer’s instinct: Use a castTo Node and then do a common function call
so, why UE don’t use StandardMacro/Functions to fullfill this eyecandie as usual, but create a new Message concept? especiall, the “Event” concept in BP is already messy.
The whole point of the interface message, is that you can call it on an actor without knowing what kind of actor it is, or even if it implements the interface.
Loose coupling. No assumptions.
thank you for replying
but what the “message” node do behind the curtain, is just automatcally create the “CastToMyInterface” node for you. which means adding a new “message” concept just saves single one node. is it worthy? and for saving node creating, there is already “Macro”.
this is what i’m confusing.
It has to cast to check it can send the message.
But it’s better in BP to hide the cast, because BP already introduces a lot of bad programming habits.
The moment you let people cast to the interface in BP, 99.9% of them will just cast to the receiver, not understanding that this negates the whole point of the interface.
In BP, you have ‘DoesImplementInterface’, which is basically the cast.