Communication between blueprint

Hello,

i have begin to use UE4. I want to modify the size of an asset (a) depending of a variable from another blueprint (b). I did it by calling a function of (a) in the blueprint (b). But i foud that’s it isn’t an elegant solution (in the future i envisage to modify the size of a lot of asset independantly). So i would know if there is a way that each asset access the variable without being called or another to way to don’t call too much function.

Thank you for your attentioN.

You can abstract out the call to the (a) asset using Blueprint Interface.

Example:
You have a blueprint interface I_modifiable with functions: modifySize, changeRotation, applyOffset and so on.

Than in your blueprint (b) you ask Does Implement Interface (I_modifiable) - and than call function modifySize from it.

But than Interfaces are only declaration of a function, you still need to implement it in your asset (a). So you can make assets (a1) and (a2) have different implementation. For example, (a2) would have Z axis locked or something. If this is not desirable, you can (and should) create an Asset (a_Parent), add an Interface to it

, from which you create childs (a1) and (a2). If your (a3) asset should have a different scale behavior - you still can override it later.

This way you don’t need to know anything about an asset you want to call modifySize function except that it has a needed interface. And you can add this interface to any number of assets (still need to implement it).

Thanks for you answer, i took a look to interface documentation and tried to implement it.

I have still one problem, when i want to call the function using the interface i have to precise a target and so for which asset i will call the function.