So I was told that you can search for C++ function equivalents of Blueprint nodes if you right-click a blueprint node and choose “Goto Definition” (only works for C++ projects).
So I made a fresh new C++ project to test this out. Made a dummy blueprint and added a node to test but when I click “Goto Definition” nothing happens.
This is because you are using a launcher-installed version of the engine. The source-baked paths for those versions will not correspond to where you have the engine installed (unless that happens to be D:/++Build/UE4/Sync). However, it will work for any blueprint-exposed functions you create.
It is kind of a tedious workaround, but there is a way for you to view the source for a built-in Blueprint function. Using “Predict Projectile Path by TraceChannel” as an example, if you hover over the node in the editor you will see at the bottom of the tooltip what the target is. For that node, the target is “Gameplay Statics.” If you then open GameplayStatics.h (located in %EngineInstallDir%/Engine/Source/Runtime/Engine/Classes/Kismet), you can see that the function Blueprint_PredictProjectilePath_ByTraceChannel has the display name of the node we’re looking for. You can then open GameplayStatics.cpp (located in %EngineInstallDir%/Engine/Source/Runtime/Engine/Private) to find that function and view its source.
Too shame this problem happened since 4.17 and still not be solved, even in 4.21.2.
Before 4.17 everything’s okay, you can easily “goto definition” in launcher-installed version.
Do Epic has any solutions for this in the future?
There is an easy way. Taking this “Hide Bone by Name” blueprint node as an example:
Go to you code editor and go to the “Find in files” feature:
(Screenshot example with Rider here, but Visual Studio also has this feature in Menu bar → Edit → Find and Replace → Find in Files)
Finally TYPE the name of the function as seen in the blueprint node but WITHOUT SPACES
(The Blueprint Node displays spaces between the words of the function to make things look nice)
The search results of the Find in Files feature reveals the whereabouts in the C++ Unreal library
Double click the line in the search result that matches what you are looking for and it will open the file in question revealing the full path.
Now you can include the .h file in your code and call the function
you can either build the engine yourself, OR you can move the launcher-installed engine to that folder. You’ll have to create a D: drive in your PC and also rename the folder where the engine got installed to “Sync”. The Sync folder is the one that should contain the folders Engine, FeaturePacks, Samples, and Templates. Here’s what it should look like (I have the source-built engine so mine might look a bit different):
I cant get it to work. i make a link in d:\Build++UE4\ named Sync to my unreal engine directory. and nothing happens if i click “go to definition”. not even visual studio is showing up.
can anybody give me an advice?
How do I look up C++ function equivalents of Blueprint nodes?
The quickest way I’ve found is to copy the Blueprint node and paste it into a text editor.
For example here’s a node I copied:
Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_11" ExportPath="/Script/BlueprintGraph.K2Node_CallFunction'/IslandGenerator/Spawner/BP_Spawner.BP_Spawner:EventGraph.K2Node_CallFunction_11'"
bIsPureFunc=True
FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/NavigationSystem.NavigationSystemV1'",MemberName="GetNavigationSystem")
....
End Object
I omitted some of the output, but what you’re looking for is the line starting with “FunctionReference” which will point you to the C++ class and method in this case NavigationSystemV1::GetNavigationSystem.