Geting bp function from any actor?

Hi, how can i create global BP function and later call it from any BP in game, for example i have 2(++) weapons, in first weapon BP i have function to check current physics material when i shoot, but now i cant use this function in second weapon BP, for now i copy all nodes from one weapon BP to another BP, but better i think will be just some how call this function from anywhere, so how i can create some kind stuff? thx

Hi ,

You have two options here:

  1. You can create a Parent weapon class that has basic functions you need for weapons, and then create a Child class that use different meshes and assign extra functionality. There’s an example in Content Examples you can look at inside Blueprints_Advanced map, and you can read about it here: https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/Blueprints_Advanced/2_5/index.html
  2. You can create a Blueprint Function Library, which contains static Functions that can be used by other Actors in your game. Create one in editor by clicking Add New button, and under Blueprints you’ll find Blueprint Function Library. You can then call these functions from any other BP.

Of two, I would recommend using Parent/Child functionality for this type of setup. Hope that helps!

thx ** **, that is what i need!!