How to Designate Level Actor as BP Node Target in Function Library?

Hello,

I have extended the Level Actor class to add custom C++ code and nodes to the Level BP. Now, I want to move some of the Level BP functions to a Function Library.

The custom function nodes require a target. In the Level BP the target was ‘Self’. Now, in the Function Library, I need to give the pin something other than ‘Self’. Ideally, a reference to the extended Level Actor.

It seems that I could use an event and delegate for this, but in the interest of efficiency, I would prefer just to make a function call.

How can I do this?

do you just want to make a function that takes your custom level Actor?

You need to pass some form of “Context” object on which that function will run or from which you can get access to your extended LevelBP class, or pass it directly as an argument of your function. It might be wise to cast it to your LevelBP class before using it and trying to call function on. Your “Self” was actually pointer to itself, in C++ it would translate roughly to “this” keyword.