Blueprint Function Library vs BP Component

There seems to be a lot of similarities between what they both can do. Is one better to use than the other, performance differences?

Thanks

Actor Component. Sorry about that.

91347-bp.jpg

Cmc,

Perhaps this is just my own stupidity, but I’m not sure what you mean by a BP Component? and are you referring to a BP Function Library that is a C++ plugin?

.

To me it’s hard to compare a Blueprint Function Libarary, to a Component. The reason being, something has to create the Component. Whether it’s a function library or you create a Blueprint, that inherits from a Actor.

Function libraries, are essentially that, just functions, where as a Component of any form, is in general what a Static mesh is applied too (along with the materials that are applied to the SM, and then of course the textures, etc that comprise the Material).

In truth, a “Actor”, is little more than an object in the game, that is like the central point for Meshes, actions, etc. If you will, it’s the “warehouse” of everything for that object. If you look into how the Engine is written, Components don’t exist in the game standalone, somewhere lurking there is always a actor, that the components are attached too. At the same time, the “Actors” don’t really have any static meshes, etc, that are their own, there will always be a pointer to a root component (Scene Component) for that actor, which is where all the “visuals” are. Yet, The Components cannot exist inside the world, without being attached to an actor.

So it’s hard to think of a function library, that has functions that do X, as something that would be compared to a Actor.

Hopefully this helps, not for sure it really does!

.

Function Libraries do nothing themselves, they just have functions your can call from other blueprints.

Components actually incorporate functionality.

Function Library Example:
If i wanted an easy consistent way of getting the distance between two points and i was tired of doing the blueprint node setup for that each time i could create a function local to my blueprint to handle that. The downside is i want to get point distances throughout my code so instead i can put it into a function Library to call the same code from everywhere.

Component Example:
I want to be able to apply thrust to any actor. I can’t handle this in code Hierarchy because I want the same code for any class of actor. So i make an Actor Component that on begin play gets its owner and applies an acceleration. Now when the user clicks an actor i just add a component to it and no matter its class it will shoot off into the sky.

Yes it does thanks. I was focused on the functions of the component instead of taking into account the rest of it’s functionality.