C++ vs Blueprint Node

Hi All,

Probably a silly question, but I’m just trying to understand how Unreal handles C++ vs Blueprints.

Let’s say I build a line trace by channel function in C++ that’s callable in blueprints and it’s essentially the same as the standard Line Trace By Channel node that Unreal already offers in blueprints.

Is there still a performance benefit to calling my C++ Line Trace function from my child blueprint vs just using the standard blueprint line trace node? My understanding is that Unreal’s Standard Blueprint nodes are still built in C++. So, in this example is there any benefit?

Or, is the benefit to writing code in C++ more about replacing entire chains of nodes with C++ as opposed to single functions?

I’m asking because I’ve read it’s usually more performant to put operations like line traces (especially if on tick) in C++. Does making it callable in blueprints negate the performance benefit of C++?

Appreciate any insights here as I’m just trying to learn. Thanks!

Blueprint node themself are equivalent to c++.

It actually like you said, the connection between 2 node that make it slow. (because it need to jump in out of a node). By the time it enter a node, it as fast as a cpp.
That also why a for loop is slow because it has lot of white lines between nodes.

So the longer the connections between nodes without a delay/latent function in between, will make the execution relatively slow.

That also why it important to choose an inbuild function node for example, using a Split node rather than making a for each of a string.

1 Like

Here the video link with timer:

2 Likes

Wow, this video is super helpful (as is your explanation). Makes sense. Thanks so much for sharing!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.