Download

Good practice in practice

Hey all!

I was working on a part of code in which a service in a behaviour tree triggers a function in an animation blueprint.
The blueprints are connected but through quite a few other blueprints, to be specific:

BT_Service -> AI_Controller -> Pawn -> Animation_BP

So basically there are 2 approaches (i know of) to tackle this “link” between the two blueprints:

  1. Each intermediate blueprint (AI_Controller and Pawn) have a function that pass on the information/functionCall.
  2. Use a few gets and casts in a row in BT_Service itself to find the Animation_BP to call the desired function directly.

From good practices/efficiency/scalability points of views, what are good arguments to choose for one or another? Maybe there are better more clever ways of solving this issue? Right now i use option 1, but for no particular reasons! I suppose the same reasons one can come up with here also apply to C++, if not why?

Thanks a lot!